Skip to content

Commit 30f3478

Browse files
committed
Use trust store for ssl validation
1 parent 6adca9a commit 30f3478

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/event-bus/webhook/src/main/java/org/apache/cloudstack/mom/webhook/WebhookDeliveryThread.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
import org.apache.http.client.config.RequestConfig;
4949
import org.apache.http.client.methods.CloseableHttpResponse;
5050
import org.apache.http.client.methods.HttpPost;
51+
import javax.net.ssl.SSLContext;
52+
5153
import org.apache.http.conn.ssl.NoopHostnameVerifier;
5254
import org.apache.http.conn.ssl.TrustAllStrategy;
5355
import org.apache.http.entity.ContentType;
@@ -97,7 +99,9 @@ protected boolean isValidJson(String json) {
9799

98100
protected void setHttpClient() throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
99101
if (webhook.isSslVerification()) {
100-
httpClient = HttpClients.createDefault();
102+
httpClient = HttpClients.custom()
103+
.setSSLContext(SSLContext.getDefault())
104+
.build();
101105
return;
102106
}
103107
httpClient = HttpClients

0 commit comments

Comments
 (0)