Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
23.6k views
in Java FTP by (1.1k points)
Hello,

I don't understand well FTP SSL. I'm using Filezilla server, auto-signed certificat generated by Filezilla. I read documentation (How to) of edtFTPj/PRO, but it's defintily not enough for newbie in the world of SSL.

Can help me to find an example ?

Best regards

34 Answers

0 votes
by (161k points)
Enable logging in edtFTPj/PRO at DEBUG level and post the log file.
0 votes
by (1.1k points)
INFO [SSLFTPClient] 6 d
0 votes
by (161k points)
Here's the problem:

The CN (Common Name), localhost, on the server's certificate does not match its hostname, 10.0.0.164

If you connect to 'localhost' it should work (provided you are connecting from localhost). Alternatively it is also possible to disable checking of the certificate's common name.

You can also generate a new certificate on the server and provide a different common name, e.g. 10.0.0.164
0 votes
by (1.1k points)
Ok, now i understand. (i edited hostname on CompleteFTP and this work).
0 votes
by (1.1k points)
A last question : is the certificate generated by CompleteFTP, a root certificate ?

(And what is the difference between a root and a non-root certificate)
0 votes
by (1.1k points)
I'm using CuteFTP Client generating client certificate. It works well to connect to the servia via this client.

But with the code ... it doesn't work.

ftps.loadClientCertificate("C:\\CertificatClient.crt", "myPassword");


i tried also :

ftps.loadClientCertificate("C:\\CertificatClient.crt", "C:\\CertificatClient.key");


But doesn't work too.

(CuteFTP Client generated 3 files : 1 CRT, 1 CST, 1 KEY file)

The exception is : Exception : java.io.IOException: Couldn't find private key in this file
0 votes
by (51.2k points)
A last question : is the certificate generated by CompleteFTP, a root certificate ?

(And what is the difference between a root and a non-root certificate)


Wikipedia has a good explanation of root certificates and self-signed certificates.

The correct term for the certificates generated by CompleteFTP is self-signed certificates. Since these certificates could be use to sign other certificates they could conceptually be used as root certificates.

- Hans (EnterpriseDT)
0 votes
by (161k points)
You need the client's private key and certificate to be in a single file.

You may be able to do this by pasting the private key information into the certificate file, so you get something like this

-----BEGIN RSA PRIVATE KEY-----
(Your Private Key)
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
(Your certificate)
-----END CERTIFICATE-----
0 votes
by (1.1k points)
Thanks a lot for your help. Now i got a problem, on the LoadClientCertificate fonction :

DEBUG [ProFTPClient] 7 d
0 votes
by (161k points)
You need to catch any exceptions thrown and print them out with the stack trace.

Email us your client certificate file and passphrase if you want us to test it - support@enterprisedt.com

Categories

...