Allow `useOpenSsl` to be configured by `ClientFactoryBuilder`
Motivation:
Let users configure useOpenSsl client option when using ClientFactoryBuilder or ServerBuilder
Example Client
ClientFactory
.builder()
.useOpenSsl(false)
.build();
Server
Server.builder()
.virtualHost("*.example1.com")
.service("/example", (ctx, req) -> HttpResponse.of(HttpStatus.OK))
.tlsSelfSigned()
.useOpenSsl(true)
.and()
.virtualHost("*.example2.com")
.service("/example", (ctx, req) -> HttpResponse.of(HttpStatus.OK))
.tlsSelfSigned()
.useOpenSsl(false)
.and()
.virtualHost("*.example3.com")
.service("/example", (ctx, req) -> HttpResponse.of(HttpStatus.OK))
.and()
.build();
Modifications:
- Add
useOpenSslmethod inClientFactoryBuilderto allow users choose whether to use openSsl. SslContextUtil'screateSslContext(...)method is modified to receiveuseOpenSslas an argument to determine whatSslProviderit should use(OPENSSLorJDK).- Users can set
useOpenSslfield inServerBuilder. - Add
useOpenSslmethod inVirtualHostBuilder.
Result:
- Closes #<4949>. (If this resolves the issue.)
- Users will be able to configure
useOpenSslusingClientFactoryBuilderorServerBuilder
I'll start working on this issue again ๐
๐ Build Scanยฎ (commit: 623c075cdb1ef2a5612f24bec8970b82c0807e71)
| Job name | Status | Build Scanยฎ |
|---|---|---|
| build-windows-latest-jdk-21 | โ | https://ge.armeria.dev/s/l7w3hspopvzda |
| build-self-hosted-unsafe-jdk-8 | โ | https://ge.armeria.dev/s/r7kvjv2l63haq |
| build-self-hosted-unsafe-jdk-21-snapshot-blockhound | โ | https://ge.armeria.dev/s/mjet5u2uxkhuc |
| build-self-hosted-unsafe-jdk-17-min-java-17-coverage | โ | https://ge.armeria.dev/s/h5fsfcl2o45hw |
| build-self-hosted-unsafe-jdk-17-min-java-11 | โ | https://ge.armeria.dev/s/quadixnwo52rw |
| build-self-hosted-unsafe-jdk-17-leak | โ | https://ge.armeria.dev/s/pzyt6kzqfykp6 |
| build-self-hosted-unsafe-jdk-11 | โ | https://ge.armeria.dev/s/66xujxwacfale |
| build-macos-12-jdk-21 | โ | https://ge.armeria.dev/s/oakkefmfaf7fu |
I've not added useOpenSsl because tlsEngineType should be a better alternative to useOpenSsl.
Please let me know if we should add support for both tlsEngineType and useOpenSsl in the ClientFactoryBuilder.
Codecov Report
Attention: Patch coverage is 83.33333% with 5 lines in your changes missing coverage. Please review.
Project coverage is 74.10%. Comparing base (
14c5566) to head (6438c82). Report is 47 commits behind head on main.
:exclamation: Current head 6438c82 differs from pull request most recent head 623c075
Please upload reports for the commit 623c075 to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## main #4962 +/- ##
============================================
+ Coverage 74.05% 74.10% +0.04%
- Complexity 21253 21313 +60
============================================
Files 1850 1853 +3
Lines 78600 78775 +175
Branches 10032 10067 +35
============================================
+ Hits 58209 58376 +167
+ Misses 15686 15682 -4
- Partials 4705 4717 +12
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Should we use TlsEngineType specified in VirtualHost? It would be better to just use the given option rather than try to guess.
@ikhoon , I've added a method to expose tlsEngineType and use that method instead of trying to guess.
@trustin Thank you for thorough review. ๐
@seonWKim, ๐ ๐ ๐