From 3474bebd528879d2f5e7a8f11a87f6b67404739b Mon Sep 17 00:00:00 2001 From: wangzhiyong69 Date: Wed, 29 Dec 2021 18:23:36 +0800 Subject: [PATCH] add gm tls support --- build/pack.sh | 2 +- core | 2 +- deploy/deploy-gateway/pom.xml | 3 +++ .../src/main/resources/assembly.xml | 1 + .../config/application-gw.properties | 23 ++++++++++++---- .../src/main/resources/assembly.xml | 4 +++ .../config/application-peer.properties | 22 +++++++++++++--- libs/bft-smart | 2 +- libs/httpservice | 2 +- libs/utils | 2 +- project | 2 +- tree.txt | 26 ------------------- 12 files changed, 50 insertions(+), 41 deletions(-) delete mode 100644 tree.txt diff --git a/build/pack.sh b/build/pack.sh index 34d87ff8..51baae7d 100755 --- a/build/pack.sh +++ b/build/pack.sh @@ -21,7 +21,7 @@ fi echo "--------------- 开始编译打包 ---------------" cd $DEPLOY_DIR -echo "当前目录:`pwd`" +echo "当前目录:$(pwd)" #初始化变量 SKIP_TESTS; if [ ! $SKIP_TESTS ] diff --git a/core b/core index 97f0839d..b6892393 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 97f0839d82430462f85e4a510db612db5f2daaf8 +Subproject commit b68923932c2397d619217b42e042221bfeb8d7cf diff --git a/deploy/deploy-gateway/pom.xml b/deploy/deploy-gateway/pom.xml index e7e20c8a..b790ad89 100644 --- a/deploy/deploy-gateway/pom.xml +++ b/deploy/deploy-gateway/pom.xml @@ -45,6 +45,9 @@ org.springframework.boot spring-boot-maven-plugin + + true + diff --git a/deploy/deploy-gateway/src/main/resources/assembly.xml b/deploy/deploy-gateway/src/main/resources/assembly.xml index 09a964df..c1595bd8 100644 --- a/deploy/deploy-gateway/src/main/resources/assembly.xml +++ b/deploy/deploy-gateway/src/main/resources/assembly.xml @@ -24,6 +24,7 @@ docs unix + diff --git a/deploy/deploy-gateway/src/main/resources/config/application-gw.properties b/deploy/deploy-gateway/src/main/resources/config/application-gw.properties index bcf7d476..464efe20 100644 --- a/deploy/deploy-gateway/src/main/resources/config/application-gw.properties +++ b/deploy/deploy-gateway/src/main/resources/config/application-gw.properties @@ -2,14 +2,27 @@ server.compression.enabled=true server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain -# SSL -server.ssl.protocol= -server.ssl.enabled-protocols= -server.ssl.ciphers= +# TLS server.ssl.key-store= server.ssl.key-store-type=PKCS12 server.ssl.key-alias= server.ssl.key-store-password= +server.ssl.protocol= +server.ssl.enabled-protocols= +server.ssl.ciphers= server.ssl.trust-store= server.ssl.trust-store-password= -server.ssl.trust-store-type=JKS \ No newline at end of file +server.ssl.trust-store-type=JKS +server.ssl.hostNameVerifier=NO-OP + +#GM TLS +#: http.secure=true && server.ssl.protocol=GMSSLv1.1 +#ʾ: +#server.ssl.key-store=cert/sm2.node0.both.pfx +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-alias= +#server.ssl.key-store-password=12345678 +#server.ssl.protocol=GMSSLv1.1 +#server.ssl.hostNameVerifier=NO-OP +#server.ssl.enabled-protocols=TLSv1.2,GMSSLv1.1 +#server.ssl.ciphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,ECC_SM4_CBC_SM3,ECDHE_SM4_GCM_SM3,ECDHE_SM4_CBC_SM3 diff --git a/deploy/deploy-peer/src/main/resources/assembly.xml b/deploy/deploy-peer/src/main/resources/assembly.xml index 2594ae14..5cbf00eb 100644 --- a/deploy/deploy-peer/src/main/resources/assembly.xml +++ b/deploy/deploy-peer/src/main/resources/assembly.xml @@ -24,6 +24,10 @@ docs unix + + ${basedir}/../../libs/utils/utils-sm-tls/lib + libs + diff --git a/deploy/deploy-peer/src/main/resources/config/application-peer.properties b/deploy/deploy-peer/src/main/resources/config/application-peer.properties index 728ed961..1de58741 100644 --- a/deploy/deploy-peer/src/main/resources/config/application-peer.properties +++ b/deploy/deploy-peer/src/main/resources/config/application-peer.properties @@ -5,13 +5,27 @@ server.compression.mime-types=application/json,application/xml,text/html,text/xm # 管理服务TLS配置 server.ssl.enabled=false server.ssl.client-auth=none -server.ssl.protocol= -server.ssl.enabled-protocols= -server.ssl.ciphers= server.ssl.key-store= server.ssl.key-store-type=PKCS12 server.ssl.key-alias= server.ssl.key-store-password= server.ssl.trust-store= server.ssl.trust-store-password= -server.ssl.trust-store-type=JKS \ No newline at end of file +server.ssl.trust-store-type=JKS +server.ssl.protocol= +server.ssl.enabled-protocols= +server.ssl.ciphers= +server.ssl.hostNameVerifier=NO-OP + +#GM TLS配置 +#启用条件: server.ssl.enabled=true && server.ssl.protocol=GMSSLv1.1 +#示例: +#server.ssl.enabled=true +#server.ssl.key-store=cert/sm2.node0.both.pfx +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-alias= +#server.ssl.key-store-password=12345678 +#server.ssl.protocol=GMSSLv1.1 +#server.ssl.hostNameVerifier=NO-OP +#server.ssl.enabled-protocols=TLSv1.2,GMSSLv1.1 +#server.ssl.ciphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,ECC_SM4_CBC_SM3,ECDHE_SM4_GCM_SM3,ECDHE_SM4_CBC_SM3 \ No newline at end of file diff --git a/libs/bft-smart b/libs/bft-smart index 73f80091..6392c0e9 160000 --- a/libs/bft-smart +++ b/libs/bft-smart @@ -1 +1 @@ -Subproject commit 73f80091f432201a5d6793a13098f5e8560901e9 +Subproject commit 6392c0e98e8bfea0dcd0dea6c0e4e372bb404848 diff --git a/libs/httpservice b/libs/httpservice index 5257ed25..2d1f81dc 160000 --- a/libs/httpservice +++ b/libs/httpservice @@ -1 +1 @@ -Subproject commit 5257ed25bc6b89af413842739d06f8923e40ab14 +Subproject commit 2d1f81dcc672cd34ea7ddcee882a0ddc1453075c diff --git a/libs/utils b/libs/utils index df08741c..633eb609 160000 --- a/libs/utils +++ b/libs/utils @@ -1 +1 @@ -Subproject commit df08741c65808d5f36ca032152b0bcc341a5a409 +Subproject commit 633eb609c0874b2fdfb772edd6c73c7123fca0fa diff --git a/project b/project index db4db74c..8e39c385 160000 --- a/project +++ b/project @@ -1 +1 @@ -Subproject commit db4db74cc03d3a45d01a85893665372a6fd95bbc +Subproject commit 8e39c385db8bcb484da7a134ec2721bfe59726e1 diff --git a/tree.txt b/tree.txt deleted file mode 100644 index 695c4b34..00000000 --- a/tree.txt +++ /dev/null @@ -1,26 +0,0 @@ -[INFO] Scanning for projects... -[WARNING] -[WARNING] Some problems were encountered while building the effective model for com.jd.blockchain:jdchain-parent:pom:1.1.4.RELEASE -[WARNING] 'parent.relativePath' of POM com.jd.blockchain:jdchain-dependencies:1.1.4.RELEASE (F:\gitCode\jdchain-all\jdchain\project\dependencies\pom.xml) points at com.jd.blockchain:jdchain-project instead of org.springframework.boot:spring-boot-starter-parent, please verify your project structure @ com.jd.blockchain:jdchain-dependencies:1.1.4.RELEASE, F:\gitCode\jdchain-all\jdchain\project\dependencies\pom.xml, line 6, column 10 -[WARNING] -[WARNING] Some problems were encountered while building the effective model for com.jd.blockchain:bft-smart:jar:0.6.1.RELEASE -[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 89, column 12 -[WARNING] -[WARNING] Some problems were encountered while building the effective model for com.jd.blockchain:bft-smart:jar:0.6.1.RELEASE -[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 89, column 12 -[WARNING] -[WARNING] Some problems were encountered while building the effective model for com.jd.blockchain:bft-smart:jar:0.6.1.RELEASE -[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 89, column 12 -[WARNING] -[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. -[WARNING] -[WARNING] For this reason, future Maven versions might no longer support building such malformed projects. -[WARNING] -[ERROR] [ERROR] Project 'com.jd.blockchain:utils-serialize:1.2.1.RELEASE' is duplicated in the reactor @ -[ERROR] Project 'com.jd.blockchain:utils-serialize:1.2.1.RELEASE' is duplicated in the reactor -> [Help 1] -[ERROR] -[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. -[ERROR] Re-run Maven using the -X switch to enable full debug logging. -[ERROR] -[ERROR] For more information about the errors and possible solutions, please read the following articles: -[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DuplicateProjectException