FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support Jetty's live cert reload on HTTPS frontend by mlsorensen · Pull Request #7355 · apache/cloudstack · GitHub

Support Jetty's live cert reload on HTTPS frontend - #7355

Merged
mlsorensen merged 2 commits into
apache:mainfrom
mlsorensen:jetty-reload-https-cert
Mar 22, 2023
Merged

mlsorensen merged 2 commits into
apache:mainfrom
mlsorensen:jetty-reload-https-cert

Conversation

Copy link
Copy Markdown
Contributor

Description

This PR implements Jetty's hot certificate reload per jetty/jetty.project#5042

When the keystore changes, the API server begins using the new certificate. Note that this functionality doesn't support live change of keystore password, only certificate.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Tested locally with self-signed certs. Changed the cert in the keystore while management server was running, reloaded the website, and inspected the https certificate.

Tested against cmk, which continued to function after the cert change. Also tested against UI - website needed to be refreshed due to browser security. Perhaps a future enhancement would catch these errors and auto-refresh?

Here you can see the local cloudstack management server using a new cert after it is loaded into a keystore:

[root@kvmlab1 management]# echo | openssl s_client -showcerts -connect localhost:8443 2>/dev/null | openssl x509 -inform pem -noout -text | grep "Not Before"
            Not Before: Mar 21 21:09:50 2023 GMT

change cert

[root@kvmlab1 management]# openssl x509 -req -in cloud.csr -signkey cloud.key > cloud.crt
Signature ok
subject=C = US, ST = UT, L = Alpine, O = Marcus, OU = Marcus, CN = kvmlab1, emailAddress = example@example.com
Getting Private key

[root@kvmlab1 management]# openssl pkcs12 -export -in cloud.crt -inkey cloud.key -name cloud -passout pass:****** > cloud-localhost.pk12

[root@kvmlab1 management]# keytool -importkeystore -srckeystore cloud-localhost.pk12 -srcstoretype PKCS12 -destkeystore cloud.jks  -deststoretype JKS -srcstorepass ****** -deststorepass ******  -destkeypass ****** -noprompt
Importing keystore cloud-localhost.pk12 to cloud.jks...
Warning: Overwriting existing alias cloud in destination keystore
Entry for alias cloud successfully imported.
Import command completed:  1 entries successfully imported, 0 entries failed or cancelled

check cert

[root@kvmlab1 management]# echo | openssl s_client -showcerts -connect localhost:8443 2>/dev/null | openssl x509 -inform pem -noout -text | grep "Not Before"
            Not Before: Mar 21 21:24:47 2023 GMT

Signed-off-by: Marcus Sorensen <mls@apple.com>
mlsorensen changed the title Support Jetty's live cert reload Support Jetty's live cert reload on HTTPS API Mar 21, 2023
mlsorensen changed the title Support Jetty's live cert reload on HTTPS API Support Jetty's live cert reload on HTTPS frontend Mar 21, 2023

codecov Bot commented Mar 21, 2023
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #7355 (cc00c6a) into main (2aa3f98) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #7355   +/-   ##
=========================================
  Coverage     12.68%   12.68%           
  Complexity     8656     8656           
=========================================
  Files          2718     2718           
  Lines        256169   256169           
  Branches      39932    39932           
=========================================
  Hits          32504    32504           
  Misses       219531   219531           
  Partials       4134     4134           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

weizhouapache left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

code lgtm

yadvr left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code LGTM - but haven't tested it.

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!   

0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells

0.0% Coverage
0.0% Duplication

Copy link
Copy Markdown
Contributor Author

Merging based on 2x LGTM and manual testing of feature.

mlsorensen merged commit 9ca5f28 into apache:main Mar 22, 2023
mlsorensen deleted the jetty-reload-https-cert branch March 22, 2023 20:38

yadvr commented Mar 23, 2023

Copy link
Copy Markdown
Member

Sorry @mlsorensen per community guidelines, there were no @blueorangutan smoketests were performed and generally, it's not preferred that PR author serves manual tests.

However, it's possible there's no regression as smoketests in Github Actions against simulator have passed. I'll kick a round of BO smoketests on #7344

yadvr added this to the 4.19.0.0 milestone Mar 23, 2023
kishankavala pushed a commit to shapeblue/cloudstack that referenced this pull request Apr 13, 2023
* Support Jetty's live cert reload

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Update ServerDaemon.java

---------

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
soreana pushed a commit to leaseweb/cloudstack that referenced this pull request May 19, 2023
* Support Jetty's live cert reload

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Update ServerDaemon.java

---------

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
yadvr pushed a commit to shapeblue/cloudstack that referenced this pull request Sep 27, 2023
* Support Jetty's live cert reload

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Update ServerDaemon.java

---------

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
(cherry picked from commit 9ca5f28)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL