-
Notifications
You must be signed in to change notification settings - Fork 52
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
FIPS support ! : by enhancing the winrm4j library to support TLS using Bo… #102
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,7 +266,7 @@ private static void initializeClientAndService(WinRm winrm, WinRmClientBuilder b | |
bp.getRequestContext().put(AuthSchemeProvider.class.getName(), authSchemeRegistry); | ||
|
||
AsyncHTTPConduit httpClient = (AsyncHTTPConduit) client.getConduit(); | ||
|
||
if (disableCertificateChecks) { | ||
TLSClientParameters tlsClientParameters = new TLSClientParameters(); | ||
tlsClientParameters.setDisableCNCheck(true); | ||
|
@@ -291,8 +291,19 @@ public X509Certificate[] getAcceptedIssuers() { | |
if (hostnameVerifier != null || sslSocketFactory != null || sslContext != null) { | ||
TLSClientParameters tlsClientParameters = new TLSClientParameters(); | ||
tlsClientParameters.setHostnameVerifier(hostnameVerifier); | ||
tlsClientParameters.setSSLSocketFactory(sslSocketFactory); | ||
tlsClientParameters.setSslContext(sslContext); | ||
if(sslSocketFactory != null) { | ||
if(sslSocketFactory.getDefaultCipherSuites()!=null && Arrays.asList(sslSocketFactory.getDefaultCipherSuites()).size()>0) { | ||
tlsClientParameters.setCipherSuites(Arrays.asList(sslSocketFactory.getDefaultCipherSuites())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at how the
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indents not aligned - is this a mix of tabs and spaces? |
||
} | ||
if(sslContext != null) { | ||
tlsClientParameters.setSslContext(sslContext); | ||
SSLParameters sslparams =sslContext.getDefaultSSLParameters(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fails to compile for me because there is no import for |
||
//To make sure that the protocols are correctly set in the cxf context | ||
if(sslparams.getProtocols() !=null && sslparams.getProtocols().length>0) { | ||
tlsClientParameters.setSecureSocketProtocol(String.join(",", sslparams.getProtocols())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this tested? The code looks surprising: the Is it documented anywhere that it can take a list? Looking at how the code is subsequently used, it seems unlikely. |
||
} | ||
} | ||
httpClient.setTlsClientParameters(tlsClientParameters); | ||
} | ||
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); | ||
|
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.
I don't think you meant to delete this line, to set the SSLSocketFactory!