github-code-scanning[bot] commented on code in PR #14507:
URL: 
https://github.com/apache/dolphinscheduler/pull/14507#discussion_r1259516092


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-http/src/main/java/org/apache/dolphinscheduler/plugin/task/http/HttpTask.java:
##########
@@ -287,10 +292,29 @@
      *
      * @return CloseableHttpClient
      */
-    protected CloseableHttpClient createHttpClient() {
+    protected CloseableHttpClient createHttpClient() throws Exception {
         final RequestConfig requestConfig = requestConfig();
         HttpClientBuilder httpClientBuilder;
         httpClientBuilder = 
HttpClients.custom().setDefaultRequestConfig(requestConfig);
+        if (httpParameters.getEnableSSL()) {
+            TrustManager[] trustAllCerts = new TrustManager[]{new 
X509TrustManager() {
+
+                public java.security.cert.X509Certificate[] 
getAcceptedIssuers() {
+                    return null;
+                }
+
+                public void 
checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) 
{

Review Comment:
   ## Missing Override annotation
   
   This method overrides [X509TrustManager.checkClientTrusted](1); it is 
advisable to add an Override annotation.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/2992)



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-http/src/main/java/org/apache/dolphinscheduler/plugin/task/http/HttpTask.java:
##########
@@ -287,10 +292,29 @@
      *
      * @return CloseableHttpClient
      */
-    protected CloseableHttpClient createHttpClient() {
+    protected CloseableHttpClient createHttpClient() throws Exception {
         final RequestConfig requestConfig = requestConfig();
         HttpClientBuilder httpClientBuilder;
         httpClientBuilder = 
HttpClients.custom().setDefaultRequestConfig(requestConfig);
+        if (httpParameters.getEnableSSL()) {
+            TrustManager[] trustAllCerts = new TrustManager[]{new 
X509TrustManager() {
+
+                public java.security.cert.X509Certificate[] 
getAcceptedIssuers() {

Review Comment:
   ## Missing Override annotation
   
   This method overrides [X509TrustManager.getAcceptedIssuers](1); it is 
advisable to add an Override annotation.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/2993)



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-http/src/main/java/org/apache/dolphinscheduler/plugin/task/http/HttpTask.java:
##########
@@ -287,10 +292,29 @@
      *
      * @return CloseableHttpClient
      */
-    protected CloseableHttpClient createHttpClient() {
+    protected CloseableHttpClient createHttpClient() throws Exception {
         final RequestConfig requestConfig = requestConfig();
         HttpClientBuilder httpClientBuilder;
         httpClientBuilder = 
HttpClients.custom().setDefaultRequestConfig(requestConfig);
+        if (httpParameters.getEnableSSL()) {
+            TrustManager[] trustAllCerts = new TrustManager[]{new 
X509TrustManager() {
+
+                public java.security.cert.X509Certificate[] 
getAcceptedIssuers() {
+                    return null;
+                }
+
+                public void 
checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) 
{
+                }
+
+                public void 
checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) 
{

Review Comment:
   ## Missing Override annotation
   
   This method overrides [X509TrustManager.checkServerTrusted](1); it is 
advisable to add an Override annotation.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/2991)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to