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

Fix SSL self-signed certificate, update cipher suite #984

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

Conversation

torusrxxx
Copy link
Contributor

Old self-signed certificate generation doesn't always work with Oracle JVM, so I replaced it with the one which use bouncycastle.
Also the node does not try to create a self-signed certificate on start up, because the entropy collection has not yet started when initializing SSL. The self-signed certificate is created when the user turns on SSL.
Finally, SSL cipher suites with weak CBC methods are removed, and SSL cipher suites with AES 256 are added.
In the future, we should allow to import valid SSL certificate and private key.

@bertm
Copy link
Contributor

bertm commented Oct 5, 2024

Old self-signed certificate generation doesn't always work with Oracle JVM

When does it not work? Can we have a unit test for that particular case?

@@ -148,6 +144,11 @@ public Integer start(String[] args) {
return Integer.valueOf(-2);
}

String builtWithMessage = "freenet.jar built with freenet-ext.jar Build #" + ExtVersion.buildNumber + " r" + ExtVersion.cvsRevision+" running with ext build "+extBuildNumber+" r" + extRevisionNumber;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unrelated to the PR.
What's the reason for moving this around?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appeared before logging is started, and I don't find this message in the log file, so I moved it to after logging started.

@torusrxxx
Copy link
Contributor Author

Old self-signed certificate generation doesn't always work with Oracle JVM

When does it not work? Can we have a unit test for that particular case?

It's because Oracle doesn't want to let it work in all J2SE run-times. See https://stackoverflow.com/questions/29060064/sun-security-x509-certandkeygen-and-sun-security-pkcs-pkcs10-missing-in-jdk8

@@ -1989,7 +1989,10 @@ SimpleToadletServer.sendAllThemesLong=If set true, all available themes will be
SimpleToadletServer.ssl=Enable SSL?
SimpleToadletServer.sslLong=Enable SSL on the web interface. You will need the 'Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files' for it to work.
SSL.enable=Activate SSL support?
SSL.HSTS=HTTP Strict-Transport-Security max-age
SSL.HSTSLong=Set the time, in seconds, that the browser is forced to access the web interface using HTTPS. If set to 0 or if SSL is disabled, HSTS header will be disabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a note that a large value here could cause the site to become inaccessible if SSL fails. It would be good to suggest a value of a week here: note how many seconds to set so if the node is accessed at least once a week it ensures SSL access. ⇒ 10080 seconds.

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

Successfully merging this pull request may close these issues.

3 participants