Skip to content

Support reload certs in HTTPS server.#10302

Closed
yswdqz wants to merge 3 commits intoapache:masterfrom
yswdqz:updateCrt
Closed

Support reload certs in HTTPS server.#10302
yswdqz wants to merge 3 commits intoapache:masterfrom
yswdqz:updateCrt

Conversation

@yswdqz
Copy link
Copy Markdown
Member

@yswdqz yswdqz commented Jan 23, 2023

  • If this is non-trivial feature, paste the links/URLs to the design doc.

  • Update the documentation to include this new feature.

  • Tests(including UT, IT, E2E) are added to verify the new feature.

  • If it's UI related, attach the screenshots below.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.

  • Update the CHANGES log.

@yswdqz
Copy link
Copy Markdown
Member Author

yswdqz commented Jan 23, 2023

I don't know how to write unit tests(without 2 real cert), is there any way?

@wu-sheng wu-sheng added this to the 9.4.0 milestone Jan 23, 2023
@wu-sheng wu-sheng added the enhancement Enhancement on performance or codes label Jan 23, 2023
@wu-sheng
Copy link
Copy Markdown
Member

I think usually we need a manual test. I don't think tls could be easily tested.
Wait for @kezhenxu94

@kezhenxu94
Copy link
Copy Markdown
Member

kezhenxu94 commented Jan 23, 2023

I think usually we need a manual test. I don't think tls could be easily tested.
Wait for @kezhenxu94

To test the reloading mechanism, we can recreate new cert pairs with scripts and update them in test and verify the API still works before and after the update, but I'm totally ok if you don't want to test this case(make sure to test this locally). But we need to add a basic case that verify the https works, the same situation exists in our gRPC agent protocol server in this repo. You can take that as an example.

httpServer = sb.build();
httpServer.start().join();
if (config.isEnableTLS()) {
scheduledExecutorService.schedule(this::updateCert, 10, TimeUnit.SECONDS);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment on lines +182 to +185
normalInitialize(sb);
sb.annotatedService()
.pathPrefix(config.getContextPath())
.build(handlers.toArray());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you confirm this is needed when we only want to reconfigure the tls cert? I think Armeria will maintain the existing service endpoint if we didn't add new or remove existing service.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

reconfigure method will creat a new ServerBuild. So I think it is needed.
image
image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sb.buildServerConfig(config()) only set the host and port.

unit test of Armeria can also prove it.

Copy link
Copy Markdown
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

According to line/armeria#4637 this PR can't be merged until they release a new version containing the mentioned Armeria PR.

@yswdqz
Copy link
Copy Markdown
Member Author

yswdqz commented Jan 23, 2023

I have not tested it now. I will test it after they armeria release a new version.

@yswdqz yswdqz added the don't merge Don't merge this PR until this label is removed label Jan 23, 2023
@wu-sheng wu-sheng removed this from the 9.4.0 milestone Feb 5, 2023
@kezhenxu94
Copy link
Copy Markdown
Member

Armeria 1.22 is released you can continue this. https://armeria.dev/release-notes/1.22.0/

@yswdqz
Copy link
Copy Markdown
Member Author

yswdqz commented Feb 9, 2023

Got it , But when I was writing tests for dynamodb, I found that after loading the certificate on skywalking, aws would not successfully send data to the endpoint, while when loading the certificate on nginx and routing it to skywalking, aws could successfully send data to the endpoint. So the existing https server may have some bugs, I will test and finish this PR after the PR about dynamodb is finished.

@wu-sheng wu-sheng mentioned this pull request Feb 12, 2023
6 tasks
@wu-sheng wu-sheng added this to the 9.4.0 milestone Feb 18, 2023
@wu-sheng
Copy link
Copy Markdown
Member

By following #10409, we don't need to support TLS.
Close this too.

@wu-sheng wu-sheng closed this Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

don't merge Don't merge this PR until this label is removed enhancement Enhancement on performance or codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants