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 support for a Spring Boot custom key alias #1865

Merged
merged 4 commits into from Jul 2, 2019

Conversation

trustin
Copy link
Member

@trustin trustin commented Jun 28, 2019

Motivation:

The ssl.keyAlias configuration in Spring Boot is currently
unsupported.

Modifications:

  • Add CustomAliasKeyManagerFactory and CustomAliasX509ExtendedKeyManager
  • Wrap the KeyManagerFactory with CustomAliasKeyManagerFactory to
    support custom key alias
  • Miscellaneous:
    • Add @Nullable annotations where necessary

Result:

@trustin trustin added the defect label Jun 28, 2019
@trustin trustin added this to the 0.88.0 milestone Jun 28, 2019
@trustin trustin removed this from the 0.88.0 milestone Jun 28, 2019
@trustin trustin force-pushed the support_custom_key_alias branch 2 times, most recently from 0e6527a to 951371e Compare June 28, 2019 10:03
@trustin
Copy link
Member Author

trustin commented Jun 28, 2019

Will add a test case early next week.

@codecov
Copy link

codecov bot commented Jun 28, 2019

Codecov Report

Merging #1865 into master will increase coverage by 0.22%.
The diff coverage is 67.34%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1865      +/-   ##
============================================
+ Coverage     73.02%   73.25%   +0.22%     
- Complexity     8823     8868      +45     
============================================
  Files           784      786       +2     
  Lines         34670    34731      +61     
  Branches       4233     4242       +9     
============================================
+ Hits          25319    25441     +122     
+ Misses         7199     7128      -71     
- Partials       2152     2162      +10
Impacted Files Coverage Δ Complexity Δ
...a/com/linecorp/armeria/spring/ArmeriaSettings.java 75.38% <ø> (ø) 13 <0> (ø) ⬇️
...rnal/spring/CustomAliasX509ExtendedKeyManager.java 43.75% <43.75%> (ø) 4 <4> (?)
...eria/internal/spring/ArmeriaConfigurationUtil.java 70.94% <66.66%> (+9.64%) 44 <0> (+6) ⬆️
.../internal/spring/CustomAliasKeyManagerFactory.java 76.92% <76.92%> (ø) 1 <1> (?)
...src/main/java/com/linecorp/armeria/spring/Ssl.java 91.48% <85.71%> (+21.27%) 28 <12> (+10) ⬆️
.../linecorp/armeria/internal/Http2ObjectEncoder.java 71.42% <0%> (-8.58%) 12% <0%> (-1%)
...meria/internal/AbstractHttp2ConnectionHandler.java 93.33% <0%> (-3.34%) 13% <0%> (-1%)
...necorp/armeria/server/GracefulShutdownSupport.java 97.43% <0%> (-2.57%) 4% <0%> (ø)
...com/linecorp/armeria/server/saml/SamlEndpoint.java 62.5% <0%> (-2.5%) 10% <0%> (-1%)
.../com/linecorp/armeria/server/docs/ServiceInfo.java 70.73% <0%> (-2.44%) 16% <0%> (-1%)
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1574f8...b68add4. Read the comment docs.

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Nice work! @trustin

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Nice work!

Motivation:

The `ssl.keyAlias` configuration in Spring Boot is currently
unsupported.

Modifications:

- Add `CustomAliasKeyManagerFactory` and `CustomAliasX509ExtendedKeyManager`
- Wrap the `KeyManagerFactory` with `CustomAliasKeyManagerFactory` to
  support custom key alias
- Miscellaneous:
  - Add `@Nullable` annotations where necessary

Result:

- Fixes line#1843
@trustin trustin added this to the 0.88.0 milestone Jul 2, 2019
@trustin
Copy link
Member Author

trustin commented Jul 2, 2019

@anuraaga You might want to check this out as well.

@trustin trustin merged commit 3315ad3 into line:master Jul 2, 2019
@trustin trustin deleted the support_custom_key_alias branch July 2, 2019 06:45
fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
Motivation:

The `ssl.keyAlias` configuration in Spring Boot is currently
unsupported.

Modifications:

- Add `CustomAliasKeyManagerFactory` and `CustomAliasX509ExtendedKeyManager`
- Wrap the `KeyManagerFactory` with `CustomAliasKeyManagerFactory` to
  support custom key alias
- Miscellaneous:
  - Add `@Nullable` annotations where necessary

Result:

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

Successfully merging this pull request may close these issues.

Spring Ssl.getKeyAlias not used
3 participants