第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

我在程序中調(diào)用 https URL 時(shí)遇到握手失敗

我在程序中調(diào)用 https URL 時(shí)遇到握手失敗

夢(mèng)里花落0921 2023-10-13 09:52:53
請(qǐng)查看完整日志trustStore is: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/security/jssecacertstrustStore type is : jkstrustStore provider is : init truststoreadding as trusted cert:  Subject: CN=m3_external_ca_test  Issuer:  CN=m3_external_ca_test  Algorithm: RSA; Serial number: 0x1  Valid from Tue Jun 12 01:57:02 IST 2018 until Fri Jun 09 01:57:02 IST 2028adding as trusted cert:  Subject: CN=ecw-test.mtn.co.ug, C=UG  Issuer:  CN=m3_external_ca_test  Algorithm: RSA; Serial number: 0x-2afddf7d2f077bc9  Valid from Tue Jun 12 13:21:39 IST 2018 until Thu Jun 11 13:21:39 IST 2020adding as trusted cert:  Subject: EMAILADDRESS=rchhabra@xpwallet.com, CN=test.xpwallet.com, OU=ARED, O=ARED, L=RW, ST=RW, C=RW  Issuer:  CN=m3_external_ca_test  Algorithm: RSA; Serial number: 0xb165b0b05e8fed1  Valid from Mon Sep 09 13:58:16 IST 2019 until Wed Sep 08 13:58:16 IST 2021keyStore is : /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/security/jssecacertskeyStore type is : jkskeyStore provider is : init keystoreinit keymanager of type SunX509trigger seeding of SecureRandomdone seeding SecureRandomAllow unsafe renegotiation: falseAllow legacy hello messages: trueIs initial handshake: trueIs secure renegotiation: falsemain, setSoTimeout(0) called%% No cached client session*** ClientHello, TLSv1.2RandomCookie:  GMT: 1553995999 bytes = { 68, 80, 88, 59, 21, 219, 212, 92, 98, 185, 156, 181, 51, 80, 35, 252, 156, 223, 223, 151, 72, 252, 100, 85, 35, 44, 134, 21 }
查看完整描述

3 回答

?
ABOUTYOU

TA貢獻(xiàn)1812條經(jīng)驗(yàn) 獲得超5個(gè)贊

你應(yīng)該嘗試像這樣構(gòu)建客戶端


    // Creating SSLContextBuilder object

    SSLContextBuilder SSLBuilder = SSLContexts.custom();


    // Loading the Keystore file

    File file = new File("mykeystore.jks");

    SSLBuilder = SSLBuilder.loadTrustMaterial(file, "changeit".toCharArray());


    // Building the SSLContext usiong the build() method

    SSLContext sslcontext = SSLBuilder.build();


    // Creating SSLConnectionSocketFactory object

    SSLConnectionSocketFactory sslConSocFactory = new SSLConnectionSocketFactory(sslcontext,

            new NoopHostnameVerifier());


    // Creating HttpClientBuilder

    HttpClientBuilder clientbuilder = HttpClients.custom();


    // Setting the SSLConnectionSocketFactory

    clientbuilder = clientbuilder.setSSLSocketFactory(sslConSocFactory);


    // Building the CloseableHttpClient

    CloseableHttpClient httpclient = clientbuilder.build();


查看完整回答
反對(duì) 回復(fù) 2023-10-13
?
阿晨1998

TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊

您的客戶端沒(méi)有按照服務(wù)器(肯定)請(qǐng)求且顯然需要的方式發(fā)送客戶端證書(shū)。


請(qǐng)注意,您的信任庫(kù)沒(méi)有任何問(wèn)題,更改您的信任庫(kù)或信任管理器完全無(wú)關(guān)且無(wú)用。那些認(rèn)為所有 SSL/TLS 問(wèn)題都缺乏驗(yàn)證(信任)服務(wù)器證書(shū)的人就像那些認(rèn)為如果發(fā)動(dòng)機(jī)已從汽車(chē)上拆下,只要放一些汽油(或汽油/香精),它仍然會(huì)運(yùn)行良好的人/etc 取決于國(guó)家)在水箱中。


從你的調(diào)試日志:


*** CertificateRequest

Cert Types: RSA, DSS, ECDSA

Supported Signature Algorithms: SHA256withRSA, SHA256withDSA, SHA256withECDSA, SHA384withRSA, Unknown (hash:0x5, signature:0x2), SHA384withECDSA, SHA512withRSA, Unknown (hash:0x6, signature:0x2), SHA512withECDSA, SHA1withRSA, SHA1withDSA, SHA1withECDSA

Cert Authorities:

<CN=m3_external_ca_test>

服務(wù)器請(qǐng)求客戶端證書(shū),又名客戶端身份驗(yàn)證(認(rèn)證),又名雙向身份驗(yàn)證或相互身份驗(yàn)證。


Warning: no suitable certificate found - continuing without client authentication

*** Certificate chain

<Empty>

***

...

*** ECDHClientKeyExchange


[Raw read]: length = 2

0000: 02 28                                              .(

main, READ: TLSv1.2 Alert, length = 2

main, RECV TLSv1.2 ALERT:  fatal, handshake_failure

您沒(méi)有提供一份(以及證明擁有的相關(guān)簽名)。服務(wù)器中止握手,通常可能有多種原因,但此時(shí)唯一可能的原因是您沒(méi)有提供所請(qǐng)求的證書(shū)(和簽名)。


返回頂部附近:


keyStore is : /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/security/jssecacerts

keyStore type is : jks

keyStore provider is : 

init keystore

init keymanager of type SunX509

請(qǐng)注意,本節(jié)沒(méi)有說(shuō)類似的內(nèi)容,就像可用的客戶端證書(shū)一樣:


found key for : <alias>

chain [0] = [ <usually dozens of lines of data> ]

<usually chain[1], maybe chain[2] and more depending>

有兩種截然不同的證書(shū):一種是識(shí)別您(或您的設(shè)備等)并且您希望其他人信任的證書(shū),您必須擁有 privatekey ;另一種是識(shí)別您信任的其他人的證書(shū),您應(yīng)該擁有該私鑰永遠(yuǎn)沒(méi)有私鑰。對(duì)于客戶端身份驗(yàn)證,您需要第一種,但您沒(méi)有。(補(bǔ)充說(shuō)明:一般來(lái)說(shuō),對(duì)于您自己的證書(shū),您還需要一個(gè)或有時(shí)多個(gè)“鏈”或“中間”證書(shū),但在這種情況下,調(diào)試日志清楚地表明您正在使用不使用的虛擬/測(cè)試 CA鏈證書(shū)。)


要么是您或其他人準(zhǔn)備jssecacerts錯(cuò)誤,要么是使用錯(cuò)誤的文件,因?yàn)樗荚诎湃蔚钠渌说淖C書(shū),即 CA,Java 稱之為信任庫(kù)(盡管它仍然是密鑰庫(kù)格式),并且不是您自己的證書(shū),這是真正的密鑰庫(kù)。第三個(gè)證書(shū)被列為受信任,帶有EMAILADDRESS=rchhabra@xpwallet.com,看起來(lái)它可能是客戶端證書(shū),但由于您沒(méi)有私鑰,所以不能這樣使用。修復(fù)該文件,或者如果您在不同的文件中擁有帶有密鑰的客戶端證書(shū)(這將是一個(gè)很好且常用的方法),請(qǐng)改用該不同的文件。


查看完整回答
反對(duì) 回復(fù) 2023-10-13
?
RISEBY

TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超5個(gè)贊

我們通常使用 TrustStore 來(lái)信任第 3 方服務(wù)器通信。在通過(guò) HTTPS 協(xié)議進(jìn)行客戶端和服務(wù)器通信時(shí),后者始終查找其密鑰庫(kù)并將其呈現(xiàn)the public key and certificate給前者。之后,客戶端查找associated certificate in the truststore.?如果調(diào)用服務(wù)器共享的證書(shū)或證書(shū)頒發(fā)機(jī)構(gòu)不存在于客戶端信任存儲(chǔ)中(默認(rèn)情況下,Java 始終將信任存儲(chǔ)捆綁為 cacerts 并將其保留在 $JAVA_HOME/jre/lib/security 路徑中),則會(huì)SSLHandshakeException發(fā)生這種情況。要解決該問(wèn)題,您必須添加信任存儲(chǔ)。

可以使用以下命令列出默認(rèn)受信任的證書(shū)頒發(fā)機(jī)構(gòu)

keytool?-list?-keystore?cacerts

您可以使用以下命令添加信任存儲(chǔ):

keytool?-import?-trustcacerts?-alias?certAlias?-file?certFile?-keystore?trustStoreFile

默認(rèn)情況下,trustStoreFile 位置為 $JAVA_HOME/jre/lib/security/cacerts。


查看完整回答
反對(duì) 回復(fù) 2023-10-13
  • 3 回答
  • 0 關(guān)注
  • 200 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)