Function FtpConnect()
Local cUser:= cPassWord:= cServer:= cUrl:= []
cUser := "xxxxxx1"
cPassWord:= "xaxaxaF"
cServer := "ftp.xxxxxxxx.com.br"
cUrl := "ftp://" + Alltrim(cUser) + ":" + Alltrim(cPassWord) + "@" + Alltrim(cServer)
oUrl:= tURL():New(cUrl)
If Empty(oUrl)
Msginfo("Endereço Inexistente")
Return (.F.)
Endif
oClient:= TIpClientFtp():New(oUrl, .T.)
If Empty(oClient)
Msginfo("Sem Conexão")
Return (.F.)
Endif
oClient:nConnTimeout := 20000
oClient:bUsePasv := .T.
oClient:oUrl:cUserID := cUser
oClient:oUrl:cServer := cServer
oClient:oUrl:cPassword:= cPassWord
If oClient:Open() //Aqui que nao esta funcionando
If Empty(oClient:cReply)
oClient:Pasv()
Else
oClient:Pasv()
Endif
Else
Msginfo("Não abri conexão")
Return (.F.)
Endif
Return (.T.)
No arquivo de LOG criado, está retornando:
20190321-14:01:05 :INETCONNECT( ftp.xxxxxxx.com.br, 21 )
>> <pointer> <<
20190321-14:01:05 :INETERRORCODE( <pointer> )
>> 0 <<
20190321-14:01:05 :INETRECVLINE( <pointer>, , 128 )
>> 220 (vsFTPd 3.0.2) <<
20190321-14:01:05 :INETERRORCODE( <pointer> )
>> 0 <<
20190321-14:01:05 :INETSENDALL( <pointer>, 15, USER xxxxxxx1<cr><lf> )
>> 15 <<
20190321-14:01:05 :INETRECVLINE( <pointer>, , 128 )
>> 530 Non-anonymous sessions must use encryption. <<
20190321-14:01:05 :INETERRORCODE( <pointer> )
>> 0 <<
Alguém no Harbour já conseguiu conectar num servidor FTP com criptografia (TLS)?
Abraços