-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 2-way SSL when connecting with LdapServer #11070
Conversation
8f7adfd
to
4cb2fe5
Compare
4cb2fe5
to
306c221
Compare
lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/ssl/SslUtils.java
Outdated
Show resolved
Hide resolved
{ | ||
private SslUtils() {} | ||
|
||
public static SSLContext createSSLContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about creating builder instead of this factory method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it will be a different refactor. Now it is simple extraction. Maybe separate PR or commit if we go with the builder approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At most of the places we build it from config - so builder might not help us. It makes it a bit more complicated.
...in/trino-password-authenticators/src/main/java/io/trino/plugin/password/ldap/LdapConfig.java
Show resolved
Hide resolved
...in/trino-password-authenticators/src/main/java/io/trino/plugin/password/ldap/LdapConfig.java
Outdated
Show resolved
Hide resolved
...rino-password-authenticators/src/test/java/io/trino/plugin/password/ldap/TestLdapConfig.java
Outdated
Show resolved
Hide resolved
306c221
to
bd11d2b
Compare
bd11d2b
to
0f4a6c4
Compare
{ | ||
private SslUtils() {} | ||
|
||
public static SSLContext createSSLContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it will be a different refactor. Now it is simple extraction. Maybe separate PR or commit if we go with the builder approach?
0f4a6c4
to
309c8e9
Compare
cc: @mosabua Can you please take a look at the docs changes ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % one nit (not very important)
SSLContext sslContext = SSLContext.getInstance("SSL"); | ||
sslContext.init(null, trustManagers, null); | ||
return sslContext; | ||
return SslUtils.createSSLContext(Optional.empty(), Optional.empty(), Optional.of(trustCertificate), Optional.empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe we could move try catch in SslUtils and pass SSL initialisation error cause as optional parameter.
Just a heads up to everyone involved here. This change of property name and break up into multiple is essentially a breaking change for upgrades. If possible, it would be good to change this so the old config name works as legacy config or so .. but I am aware .. that might not be possible. Also props to @kpayne for finding this. |
Description
New Feature
Specific to LDAP Password Authenticator.
Adding support for 2-way SSL to LDAP Password Authenticator.
Related issues, pull requests, and links
Documentation
( ) No documentation is needed.
(x) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
(x) Release notes entries required with the following suggested text: