Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: Can you provide an example for an SSL enabled server? #5

Open
bseib opened this issue Oct 31, 2018 · 1 comment
Open

Q: Can you provide an example for an SSL enabled server? #5

bseib opened this issue Oct 31, 2018 · 1 comment

Comments

@bseib
Copy link

bseib commented Oct 31, 2018

Specifically, how do we create a simple SSLContext to pass in?

// Creates a native file system
File ftpRootDir = getFtpRootDir();
NativeFileSystem fs = new NativeFileSystem(ftpRootDir);

// Creates a noop authenticator, which allows anonymous authentication
NoOpAuthenticator auth1 = new NoOpAuthenticator(fs);

// Creates a secure SSL server with the noop authenticator
server3 = new FTPServer(auth1);
server3.setExplicitSSL(false); // support SSL connections

SSLContext sslContext = howDoWeBuildSimpleSSLContext(); // ???
server3.setSSLContext(sslContext);

// Start listening asynchronously
server3.listen(InetAddress.getLoopbackAddress(), 3333);
@proofrock
Copy link

Second this. I'd like to use a self-signed certificate, but I cannot build a SSLContext that works.

I tried:

https://stackoverflow.com/questions/12411363/java-code-to-connect-to-ftp-server-using-ssl
https://gist.github.com/erickok/7692592

Using sample certificates from:

https://github.com/freelan-developers/freelan/wiki/Sample-certificate-files

But can't get it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants