You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "HTHou (via GitHub)" <gi...@apache.org> on 2026/06/05 10:44:53 UTC

[PR] Add generic SSL/TLS configuration support [iotdb]

HTHou opened a new pull request, #17854:
URL: https://github.com/apache/iotdb/pull/17854

   ## Description
   
   This PR adds generic SSL/TLS configuration support across IoTDB client and service paths without introducing provider-specific behavior.
   
   Changes include:
   - Add a shared `RpcSslUtils` helper for SSL context setup, optional JSSE provider registration, cipher suite parsing, and keystore/truststore type detection.
   - Wire generic SSL/TLS protocol and provider options through Session, JDBC, CLI import/export tools, Thrift transport creation, REST HTTPS, and Ratis certificate loading.
   - Add generic `ssl_protocol`, `ssl_provider_class`, and `ssl_cipher_suites` configuration entries.
   - Add JDBC URL parsing coverage for the new SSL/TLS parameters.
   
   ## Validation
   
   - `./mvnw spotless:apply -pl iotdb-core/node-commons`
   - `./mvnw -pl iotdb-client/service-rpc,iotdb-core/node-commons -DskipTests compile`
   - `./mvnw -pl iotdb-client/service-rpc,iotdb-client/isession,iotdb-client/session,iotdb-client/jdbc,iotdb-client/cli -DskipTests compile`
   - `./mvnw -pl iotdb-client/jdbc -Dtest=UtilsTest#testParseSslConfig test`
   - `git diff --check`


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "HTHou (via GitHub)" <gi...@apache.org>.
HTHou commented on code in PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#discussion_r3393144543


##########
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/AbstractCli.java:
##########
@@ -156,6 +160,8 @@ static void init() {
     keywordSet.add("-" + USE_SSL_ARGS);
     keywordSet.add("-" + TRUST_STORE_ARGS);
     keywordSet.add("-" + TRUST_STORE_PWD_ARGS);
+    keywordSet.add("-" + SSL_PROTOCOL_ARGS);
+    keywordSet.add("--" + SSL_PROTOCOL_ARGS);

Review Comment:
   why using “--”



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4715018161

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=bd4bf4f9605ffc2502d492dc0ef66ac036700904584a10e9e576d2a98b008f7e -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4630717343

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [6.7% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=17854&metric=new_duplicated_lines_density&view=list) (required ≤ 5%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=aadfa7f9f4f3e0a58e1bc4fa97132f521ef2c18548c8c6154cc79b08563047a3 -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "HTHou (via GitHub)" <gi...@apache.org>.
HTHou commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4717473871

   Thanks for the review. I addressed both follow-ups:
   
   - Updated the PR description to remove the stale `ssl_provider_class` / provider-registration wording and describe the current full PR scope.
   - Added `ssl_protocol` propagation in the integration-test env helpers. When thrift client SSL is enabled, EnvFactory-created JDBC connections, Sessions, TableSessions, SessionPools, and TableSessionPools now receive the configured protocol as well.
   
   Validation:
   - `mvn spotless:apply -pl integration-test -P with-integration-tests`
   - `mvn verify -DskipUTs -Dit.test=IoTDBClientSSLIT -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false -pl integration-test -am -P with-integration-tests`
   - `git diff --check`
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4645004562

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [7.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=17854&metric=new_duplicated_lines_density&view=list) (required ≤ 5%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=3d0cf581590f9b2af5356459e5f774361e4d73e7006571f195c8672408ba0a02 -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4645111596

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [7.1% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=17854&metric=new_duplicated_lines_density&view=list) (required ≤ 5%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=1df8245f324e0504549ad339b6d74134e51b7ba602fb4f7615e69eb6bc2098af -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4631175827

   ## [Codecov](https://app.codecov.io/gh/apache/iotdb/pull/17854?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `23.84824%` with `281 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 40.81%. Comparing base ([`d563cd0`](https://app.codecov.io/gh/apache/iotdb/commit/d563cd046e28fbb1aeb99f94abcca9cba8100a99?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e335983`](https://app.codecov.io/gh/apache/iotdb/commit/e33598335c4e4a8162a37b41d0965181b456ec1c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iotdb/pull/17854?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...rc/main/java/org/apache/iotdb/rpc/RpcSslUtils.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-client%2Fservice-rpc%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Frpc%2FRpcSslUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY2xpZW50L3NlcnZpY2UtcnBjL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pb3RkYi9ycGMvUnBjU3NsVXRpbHMuamF2YQ==) | 11.87% | [141 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...a/org/apache/iotdb/tool/data/AbstractDataTool.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-client%2Fcli%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Ftool%2Fdata%2FAbstractDataTool.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY2xpZW50L2NsaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvdG9vbC9kYXRhL0Fic3RyYWN0RGF0YVRvb2wuamF2YQ==) | 0.00% | [26 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...g/apache/iotdb/tool/schema/AbstractSchemaTool.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-client%2Fcli%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Ftool%2Fschema%2FAbstractSchemaTool.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY2xpZW50L2NsaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvdG9vbC9zY2hlbWEvQWJzdHJhY3RTY2hlbWFUb29sLmphdmE=) | 0.00% | [20 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...java/org/apache/iotdb/tool/common/OptionsUtil.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-client%2Fcli%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Ftool%2Fcommon%2FOptionsUtil.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY2xpZW50L2NsaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvdG9vbC9jb21tb24vT3B0aW9uc1V0aWwuamF2YQ==) | 0.00% | [18 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [.../org/apache/iotdb/rpc/BaseRpcTransportFactory.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-client%2Fservice-rpc%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Frpc%2FBaseRpcTransportFactory.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY2xpZW50L3NlcnZpY2UtcnBjL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pb3RkYi9ycGMvQmFzZVJwY1RyYW5zcG9ydEZhY3RvcnkuamF2YQ==) | 0.00% | [18 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ava/org/apache/iotdb/session/pool/SessionPool.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-client%2Fsession%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fsession%2Fpool%2FSessionPool.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY2xpZW50L3Nlc3Npb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2lvdGRiL3Nlc3Npb24vcG9vbC9TZXNzaW9uUG9vbC5qYXZh) | 42.85% | [8 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...che/iotdb/db/conf/rest/IoTDBRestServiceConfig.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fconf%2Frest%2FIoTDBRestServiceConfig.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvY29uZi9yZXN0L0lvVERCUmVzdFNlcnZpY2VDb25maWcuamF2YQ==) | 0.00% | [8 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...nt/cli/src/main/java/org/apache/iotdb/cli/Cli.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-client%2Fcli%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fcli%2FCli.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY2xpZW50L2NsaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvY2xpL0NsaS5qYXZh) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...b/commons/service/AbstractThriftServiceThread.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-core%2Fnode-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fcommons%2Fservice%2FAbstractThriftServiceThread.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9ub2RlLWNvbW1vbnMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2lvdGRiL2NvbW1vbnMvc2VydmljZS9BYnN0cmFjdFRocmlmdFNlcnZpY2VUaHJlYWQuamF2YQ==) | 0.00% | [5 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...in/java/org/apache/iotdb/jdbc/IoTDBConnection.java](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&filepath=iotdb-client%2Fjdbc%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fjdbc%2FIoTDBConnection.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY2xpZW50L2pkYmMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2lvdGRiL2pkYmMvSW9UREJDb25uZWN0aW9uLmphdmE=) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | ... and [14 more](https://app.codecov.io/gh/apache/iotdb/pull/17854?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #17854      +/-   ##
   ============================================
   - Coverage     40.83%   40.81%   -0.02%     
   + Complexity     2613     2611       -2     
   ============================================
     Files          5201     5202       +1     
     Lines        353904   354205     +301     
     Branches      45284    45313      +29     
   ============================================
   + Hits         144505   144573      +68     
   - Misses       209399   209632     +233     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/iotdb/pull/17854?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "HTHou (via GitHub)" <gi...@apache.org>.
HTHou commented on code in PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#discussion_r3393144543


##########
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/AbstractCli.java:
##########
@@ -156,6 +160,8 @@ static void init() {
     keywordSet.add("-" + USE_SSL_ARGS);
     keywordSet.add("-" + TRUST_STORE_ARGS);
     keywordSet.add("-" + TRUST_STORE_PWD_ARGS);
+    keywordSet.add("-" + SSL_PROTOCOL_ARGS);
+    keywordSet.add("--" + SSL_PROTOCOL_ARGS);

Review Comment:
   why using “__”



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 merged PR #17854:
URL: https://github.com/apache/iotdb/pull/17854


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4717575565

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=bd4bf4f9605ffc2502d492dc0ef66ac036700904584a10e9e576d2a98b008f7e -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "Caideyipi (via GitHub)" <gi...@apache.org>.
Caideyipi commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4645241906

   I think there are two correctness issues in this PR:
   
   1. `ssl_protocol=TLS` is used as both the SSLContext algorithm and Jetty enabled protocol for REST HTTPS. In `RestService.configureSSL`, the value is passed to `sslContextFactory.setIncludeProtocols(protocol)`. The default template value is `TLS`, but JSSE enabled protocol names are normally `TLSv1.3`, `TLSv1.2`, etc., not `TLS`. So enabling REST HTTPS with the default config can leave Jetty with no matching enabled protocol / fail TLS handshakes. The context algorithm and enabled protocol list should be separate, or REST should not call `setIncludeProtocols` for the generic `TLS` value.
   
   2. The legacy SSL overloads in `BaseRpcTransportFactory` now explicitly call the new overload with `null, null`, so internal synchronous SSL clients still do not use `ssl_protocol` / `ssl_provider_class`. For example `SyncDataNodeInternalServiceClient`, `SyncConfigNodeIServiceClient`, and IoT consensus sync clients call the old overload while `enable_internal_ssl` is true. If a custom JSSE provider is required, the server side may register it through `CommonDescriptor.configureRpcSsl()`, but these clients create their SSL transport without that provider and can fail to connect. These internal clients should pass `commonConfig.getSslProtocol()` and `commonConfig.getSslProviderClass()` to the new overload.


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4714025536

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=bd4bf4f9605ffc2502d492dc0ef66ac036700904584a10e9e576d2a98b008f7e -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4714142376

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=1814514cdf114b3da517f90664192b110e825b15ed245766f5064ba8be278c3a -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#discussion_r3432761737


##########
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/RpcSslUtils.java:
##########
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.rpc;
+
+import org.apache.thrift.transport.TSSLTransportFactory;
+import org.apache.thrift.transport.TTransportException;
+
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.file.AccessDeniedException;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.stream.Stream;
+
+public final class RpcSslUtils {
+
+  private static final String DEFAULT_PROTOCOL = "TLS";
+  private static final String PKCS12_STORE_TYPE = "PKCS12";
+  private static final String JKS_STORE_TYPE = "JKS";
+
+  private static volatile String protocol = DEFAULT_PROTOCOL;
+
+  private RpcSslUtils() {}
+
+  public static void configure(String sslProtocol) {
+    protocol = normalizeProtocol(sslProtocol);
+  }
+
+  public static TSSLTransportFactory.TSSLTransportParameters createTSSLTransportParameters() {
+    return createTSSLTransportParameters(protocol);
+  }
+
+  public static TSSLTransportFactory.TSSLTransportParameters createTSSLTransportParameters(
+      String sslProtocol) {
+    return new TSSLTransportFactory.TSSLTransportParameters(normalizeProtocol(sslProtocol), null);
+  }
+
+  public static void setKeyStore(
+      TSSLTransportFactory.TSSLTransportParameters params, String keyStorePath, String keyStorePwd)
+      throws TTransportException {
+    try {
+      params.setKeyStore(
+          keyStorePath,
+          keyStorePwd,
+          KeyManagerFactory.getDefaultAlgorithm(),
+          detectStoreType(keyStorePath, keyStorePwd));
+    } catch (GeneralSecurityException | IOException e) {
+      throw new TTransportException(e);
+    }
+  }
+
+  public static void setTrustStore(
+      TSSLTransportFactory.TSSLTransportParameters params,
+      String trustStorePath,
+      String trustStorePwd)
+      throws TTransportException {
+    try {
+      params.setTrustStore(
+          trustStorePath,
+          trustStorePwd,
+          TrustManagerFactory.getDefaultAlgorithm(),
+          detectStoreType(trustStorePath, trustStorePwd));
+    } catch (GeneralSecurityException | IOException e) {
+      throw new TTransportException(e);
+    }
+  }
+
+  public static SSLContext createSSLContext(
+      String keyStorePath,
+      String keyStorePassword,
+      String trustStorePath,
+      String trustStorePassword)
+      throws GeneralSecurityException, IOException {
+    return createSSLContext(
+        keyStorePath, keyStorePassword, trustStorePath, trustStorePassword, protocol);
+  }
+
+  public static SSLContext createSSLContext(
+      String keyStorePath,
+      String keyStorePassword,
+      String trustStorePath,
+      String trustStorePassword,
+      String sslProtocol)
+      throws GeneralSecurityException, IOException {
+    SSLContext context = SSLContext.getInstance(normalizeProtocol(sslProtocol));
+    KeyManager[] keyManagers =
+        hasText(keyStorePath) ? loadKeyManagers(keyStorePath, keyStorePassword) : null;
+    TrustManager[] trustManagers =
+        hasText(trustStorePath) ? loadTrustManagers(trustStorePath, trustStorePassword) : null;
+    context.init(keyManagers, trustManagers, null);
+    return context;
+  }
+
+  public static KeyManager[] createKeyManagers(String keyStorePath, String keyStorePassword)
+      throws GeneralSecurityException, IOException {
+    return loadKeyManagers(keyStorePath, keyStorePassword);
+  }
+
+  public static TrustManager[] createTrustManagers(String trustStorePath, String trustStorePassword)
+      throws GeneralSecurityException, IOException {
+    return loadTrustManagers(trustStorePath, trustStorePassword);
+  }
+
+  public static String getProtocol() {
+    return protocol;
+  }
+
+  public static boolean isSpecificProtocol(String sslProtocol) {
+    String trimmed = trimToEmpty(sslProtocol);
+    return !trimmed.isEmpty() && !DEFAULT_PROTOCOL.equals(trimmed.toUpperCase(Locale.ROOT));
+  }
+
+  public static String normalizeStandardTlsProtocol(String sslProtocol) {
+    String protocol = normalizeProtocol(sslProtocol);
+    if (!isStandardTlsProtocol(protocol)) {
+      throw new IllegalArgumentException(
+          "Unsupported SSL protocol " + protocol + ". Only standard TLS protocols are supported.");
+    }
+    return protocol;
+  }
+
+  public static boolean isStandardTlsProtocol(String sslProtocol) {
+    String protocol = normalizeProtocol(sslProtocol).toUpperCase(Locale.ROOT);
+    return DEFAULT_PROTOCOL.equals(protocol) || protocol.matches("TLSV\\d+(\\.\\d+)*");
+  }

Review Comment:
   `isStandardTlsProtocol` currently treats any `TLSv<digits>[.<digits>...]` value as "standard" (e.g., `TLSv2`, `TLSv9`). This makes `normalizeStandardTlsProtocol` accept protocols that are not real/standard TLS protocol names and will later fail at runtime when creating the SSLContext/Thrift transport.



##########
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/RpcSslUtils.java:
##########
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.rpc;
+
+import org.apache.thrift.transport.TSSLTransportFactory;
+import org.apache.thrift.transport.TTransportException;
+
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.file.AccessDeniedException;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.stream.Stream;
+
+public final class RpcSslUtils {
+
+  private static final String DEFAULT_PROTOCOL = "TLS";
+  private static final String PKCS12_STORE_TYPE = "PKCS12";
+  private static final String JKS_STORE_TYPE = "JKS";
+
+  private static volatile String protocol = DEFAULT_PROTOCOL;
+
+  private RpcSslUtils() {}
+
+  public static void configure(String sslProtocol) {
+    protocol = normalizeProtocol(sslProtocol);
+  }
+
+  public static TSSLTransportFactory.TSSLTransportParameters createTSSLTransportParameters() {
+    return createTSSLTransportParameters(protocol);
+  }
+
+  public static TSSLTransportFactory.TSSLTransportParameters createTSSLTransportParameters(
+      String sslProtocol) {
+    return new TSSLTransportFactory.TSSLTransportParameters(normalizeProtocol(sslProtocol), null);
+  }
+
+  public static void setKeyStore(
+      TSSLTransportFactory.TSSLTransportParameters params, String keyStorePath, String keyStorePwd)
+      throws TTransportException {
+    try {
+      params.setKeyStore(
+          keyStorePath,
+          keyStorePwd,
+          KeyManagerFactory.getDefaultAlgorithm(),
+          detectStoreType(keyStorePath, keyStorePwd));
+    } catch (GeneralSecurityException | IOException e) {
+      throw new TTransportException(e);
+    }
+  }
+
+  public static void setTrustStore(
+      TSSLTransportFactory.TSSLTransportParameters params,
+      String trustStorePath,
+      String trustStorePwd)
+      throws TTransportException {
+    try {
+      params.setTrustStore(
+          trustStorePath,
+          trustStorePwd,
+          TrustManagerFactory.getDefaultAlgorithm(),
+          detectStoreType(trustStorePath, trustStorePwd));
+    } catch (GeneralSecurityException | IOException e) {
+      throw new TTransportException(e);
+    }
+  }
+
+  public static SSLContext createSSLContext(
+      String keyStorePath,
+      String keyStorePassword,
+      String trustStorePath,
+      String trustStorePassword)
+      throws GeneralSecurityException, IOException {
+    return createSSLContext(
+        keyStorePath, keyStorePassword, trustStorePath, trustStorePassword, protocol);
+  }
+
+  public static SSLContext createSSLContext(
+      String keyStorePath,
+      String keyStorePassword,
+      String trustStorePath,
+      String trustStorePassword,
+      String sslProtocol)
+      throws GeneralSecurityException, IOException {
+    SSLContext context = SSLContext.getInstance(normalizeProtocol(sslProtocol));
+    KeyManager[] keyManagers =
+        hasText(keyStorePath) ? loadKeyManagers(keyStorePath, keyStorePassword) : null;
+    TrustManager[] trustManagers =
+        hasText(trustStorePath) ? loadTrustManagers(trustStorePath, trustStorePassword) : null;
+    context.init(keyManagers, trustManagers, null);
+    return context;
+  }
+
+  public static KeyManager[] createKeyManagers(String keyStorePath, String keyStorePassword)
+      throws GeneralSecurityException, IOException {
+    return loadKeyManagers(keyStorePath, keyStorePassword);
+  }
+
+  public static TrustManager[] createTrustManagers(String trustStorePath, String trustStorePassword)
+      throws GeneralSecurityException, IOException {
+    return loadTrustManagers(trustStorePath, trustStorePassword);
+  }
+
+  public static String getProtocol() {
+    return protocol;
+  }
+
+  public static boolean isSpecificProtocol(String sslProtocol) {
+    String trimmed = trimToEmpty(sslProtocol);
+    return !trimmed.isEmpty() && !DEFAULT_PROTOCOL.equals(trimmed.toUpperCase(Locale.ROOT));
+  }
+
+  public static String normalizeStandardTlsProtocol(String sslProtocol) {
+    String protocol = normalizeProtocol(sslProtocol);
+    if (!isStandardTlsProtocol(protocol)) {
+      throw new IllegalArgumentException(
+          "Unsupported SSL protocol " + protocol + ". Only standard TLS protocols are supported.");
+    }
+    return protocol;
+  }
+
+  public static boolean isStandardTlsProtocol(String sslProtocol) {
+    String protocol = normalizeProtocol(sslProtocol).toUpperCase(Locale.ROOT);
+    return DEFAULT_PROTOCOL.equals(protocol) || protocol.matches("TLSV\\d+(\\.\\d+)*");
+  }
+
+  public static void validateKeyStore(String keyStorePath, String keyStorePassword)
+      throws TTransportException {
+    validateStore(keyStorePath, keyStorePassword);
+  }
+
+  public static void validateTrustStore(String trustStorePath, String trustStorePassword)
+      throws TTransportException {
+    validateStore(trustStorePath, trustStorePassword);
+  }
+
+  private static KeyManager[] loadKeyManagers(String keyStorePath, String keyStorePassword)
+      throws GeneralSecurityException, IOException {
+    KeyStore keyStore = loadStore(keyStorePath, keyStorePassword);
+    KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+    kmf.init(keyStore, toPassword(keyStorePassword));
+    return kmf.getKeyManagers();
+  }
+
+  private static TrustManager[] loadTrustManagers(String trustStorePath, String trustStorePassword)
+      throws GeneralSecurityException, IOException {
+    KeyStore trustStore = loadStore(trustStorePath, trustStorePassword);
+    TrustManagerFactory tmf =
+        TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+    tmf.init(trustStore);
+    return tmf.getTrustManagers();
+  }
+
+  private static String detectStoreType(String storePath, String storePassword)
+      throws GeneralSecurityException, IOException {
+    return loadStore(storePath, storePassword).getType();
+  }
+
+  private static KeyStore loadStore(String storePath, String storePassword)
+      throws GeneralSecurityException, IOException {
+    Exception lastException = null;
+    for (String storeType : storeTypeCandidates()) {
+      try {
+        return loadStore(storePath, storePassword, storeType);
+      } catch (AccessDeniedException | FileNotFoundException e) {
+        throw e;
+      } catch (GeneralSecurityException | IOException e) {
+        lastException = e;
+      }
+    }
+    if (lastException instanceof GeneralSecurityException) {
+      throw (GeneralSecurityException) lastException;
+    }
+    if (lastException instanceof IOException) {
+      throw (IOException) lastException;
+    }
+    throw new IOException("No supported keystore or truststore type is available");
+  }
+
+  private static KeyStore loadStore(String storePath, String storePassword, String storeType)
+      throws GeneralSecurityException, IOException {
+    KeyStore store = KeyStore.getInstance(storeType);
+    try (FileInputStream fis = new FileInputStream(storePath)) {
+      store.load(fis, toPassword(storePassword));
+    } catch (AccessDeniedException e) {
+      throw new AccessDeniedException("Failed to load keystore or truststore file");
+    } catch (FileNotFoundException e) {
+      throw new FileNotFoundException("keystore or truststore file not found: " + storePath);
+    }
+    return store;
+  }

Review Comment:
   `loadStore(..., storeType)` uses `new FileInputStream(storePath)` but tries to handle `java.nio.file.AccessDeniedException`. `FileInputStream` will typically throw `FileNotFoundException` (including for permission denied), so the `AccessDeniedException` path is effectively unreachable and access-denied cases will be misreported as "not found"/generic failures.



##########
iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java:
##########
@@ -136,6 +136,9 @@ static IoTDBConnectionParams parseUrl(String url, Properties info) throws IoTDBU
     if (info.containsKey(Config.TRUST_STORE_PWD)) {
       params.setTrustStorePwd(info.getProperty(Config.TRUST_STORE_PWD));
     }
+    if (info.containsKey(Config.SSL_PROTOCOL)) {
+      params.setSslProtocol(info.getProperty(Config.SSL_PROTOCOL));
+    }

Review Comment:
   JDBC URL parsing currently accepts any `ssl_protocol` value verbatim (e.g., `CUSTOMv1`). With the new `RpcSslUtils.normalizeStandardTlsProtocol(...)` and the server-side config/template stating only standard TLS protocol names are supported, it would be better to validate early here and fail with a clear `IoTDBURLException` instead of letting the connection fail later with a low-level `NoSuchAlgorithmException`/TLS error.



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4676969508

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=1350f4d77d5d112e460b8ae74762b85a500982b06c1f9681d7bb8e7db5e3fea2 -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4677120243

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=cb979b32f1f69bd3fab970731e3862427ecf2ee237cdd81b855627d93969298b -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4677059592

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) (required ≥ A)  
     
   <!-- sqra:qg_revision=cb979b32f1f69bd3fab970731e3862427ecf2ee237cdd81b855627d93969298b -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add generic SSL/TLS configuration support [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #17854:
URL: https://github.com/apache/iotdb/pull/17854#issuecomment-4750683482

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [12 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=17854&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=17854&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=17854&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=17854&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [2.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=17854&metric=new_duplicated_lines_density&view=list)  
     
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=17854)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org