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

add SSL certificate configuration support for HTTP/3 #14520

Merged
merged 8 commits into from
Aug 21, 2024

Conversation

blueuuufish
Copy link

What is the purpose of the change

Brief changelog

Verifying this change

Checklist

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

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

@oxsean PTAL

Assertions.assertNotNull(serverKeyUrl, "serverKeyUrl should not be null");
sslConfig.setServerPrivateKeyPath(
Paths.get(serverKeyUrl.toURI()).toAbsolutePath().toString());
Assertions.assertNotNull(trustCertUrl, "serverKeyUrl should not be null");
Copy link
Collaborator

Choose a reason for hiding this comment

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

trustCertUrl

Assertions.assertNotNull(clientCertUrl, "clientCertUrl should not be null");
sslConfig.setClientKeyCertChainPath(
Paths.get(clientCertUrl.toURI()).toAbsolutePath().toString());
Assertions.assertNotNull(clientKeyUrl, "serverKeyUrl should not be null");
Copy link
Collaborator

Choose a reason for hiding this comment

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

clientKeyUrl

sslConfig.setClientPrivateKeyPath(
Paths.get(clientKeyUrl.toURI()).toAbsolutePath().toString());
Assertions.assertNotNull(trustCertUrl, "trustCertUrl should not be null");
sslConfig.setClientTrustCertCollectionPath(
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can create a common method such as:

private static String getCertPath(String name) {
     java.net.URL certUrl = TripleHttp3ProtocolTest.class.getResource("/certs/"+name);
    Assertions.assertNotNull(certUrl, "Cert file '/certs/"+ name + "' is required");
    return Paths.get(certUrl.toURI()).toAbsolutePath().toString()
}

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for pointing that out.

@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need for csr

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, I've already corrected it.

@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
Copy link
Collaborator

Choose a reason for hiding this comment

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

Confirm all certificates are valid for more than 50 years

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for pointing that out.

@oxsean
Copy link
Collaborator

oxsean commented Aug 21, 2024

@AlbumenJ LGTM.

Copy link

sonarcloud bot commented Aug 21, 2024

@AlbumenJ AlbumenJ merged commit 9cb26bb into apache:3.3 Aug 21, 2024
19 checks passed
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