国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

unable to find valid certification path to requested target

這篇具有很好參考價值的文章主要介紹了unable to find valid certification path to requested target。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

調(diào)用https接口時出現(xiàn)該異常,

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

unable to find valid certification path to requested target,httpd,服務(wù)器,https

?

原因是可以看上圖,因?yàn)楸镜貨]有目標(biāo)服務(wù)器證書導(dǎo)致。解決此方法的兩種方案,1.在運(yùn)行java環(huán)境安裝對方服務(wù)器證書,可使用keytool?-printcert?-rfc?-sslserver?ip:port 后保存為cer格式。2.在http建立連接時跳過證書驗(yàn)證文章來源地址http://www.zghlxwxcb.cn/news/detail-783586.html

CloseableHttpClient httpClient = getScontractHttpClient();

public static CloseableHttpClient getScontractHttpClient() {
        SSLContext sslContext = null;
        try {
            sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
                @Override
                public boolean isTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
                    return true;
                }
            }).build();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        } catch (KeyManagementException e) {
            e.printStackTrace();
        } catch (KeyStoreException e) {
            e.printStackTrace();
        }
        //創(chuàng)建httpClient
        return HttpClients.custom().setSSLContext(sslContext).
                setSSLHostnameVerifier(new NoopHostnameVerifier()).build();

    }
    

到了這里,關(guān)于unable to find valid certification path to requested target的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • RuntimeError: Unable to find a valid cuDNN algorithm to run convolution

    RuntimeError: Unable to find a valid cuDNN algorithm to run convolution

    使用yolov5l模型訓(xùn)練時出現(xiàn)報錯,但是昨天使用yolov5s模型時是可以正常訓(xùn)練的。 發(fā)生報錯的原因是gpu內(nèi)存占用過高,terminal輸入nvidia-smi查看gpu的使用情況。 ? 我們需要把bach_size調(diào)小,一般建議是8的倍數(shù),內(nèi)存不夠用時盡量調(diào)低,此處我設(shè)置成了16。 結(jié)果運(yùn)行正常。 使用yol

    2024年02月11日
    瀏覽(97)
  • Unable to connect to the server: x509: certificate has expired or is not yet valid

    手動更新所有證書,執(zhí)行命令 更新用戶配置 用更新后的admin.conf替換/root/.kube/config文件 k8s解決證書過期官方文檔:https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/ 幫助文檔: https://www.cnblogs.com/00986014w/p/13095628.html

    2024年02月04日
    瀏覽(100)
  • 【bug解決】RuntimeError: Unable to find a valid cuDNN algorithm to run convolution

    進(jìn)行深度學(xué)習(xí)的算法模型訓(xùn)練的時候,終端報錯: 產(chǎn)生報錯的原因可能有兩種: 1.模型訓(xùn)練的環(huán)境中cudnn,CUDA的版本號不匹配 解決辦法:安裝對應(yīng)的cudnn,以及cuda,找到對應(yīng)的torch框架,進(jìn)行安裝 2.其實(shí)問題更加簡單,是模型的訓(xùn)練的batch-size訓(xùn)練過大了,調(diào)整更小,就可以了

    2024年02月11日
    瀏覽(90)
  • K8S異常之Unable to connect to the server: x509: certificate has expired or is not yet valid

    K8S異常之Unable to connect to the server: x509: certificate has expired or is not yet valid

    2.1 處理步驟 2.2 處理步驟詳細(xì)情況 如上,發(fā)現(xiàn)很多證書都是 invalid 的狀態(tài),接著更新證書: 如下,更新證書后,證書過期時間已經(jīng)更新為 365d 3.1 再次查看kubectl get node,發(fā)現(xiàn)有新的錯誤: error: You must be logged in to the server (Unauthorized) 3.2 上述錯誤解決方案 備份配置文件 cp -rp

    2024年02月03日
    瀏覽(99)
  • can‘t find model ‘zh_core_web_sm‘. It doesn‘t seem to be a python package or a valid path to a data

    can‘t find model ‘zh_core_web_sm‘. It doesn‘t seem to be a python package or a valid path to a data

    成功解決[E050] Can’t find model ‘en_core_web_sm’. It doesn’t seem to be a Python package or a valid path to a data directory. 直接上解決方案 豆瓣源安裝spacy包 zh_core_web_sm en_core_web_sm spacy中文模型官網(wǎng) spacy官網(wǎng) 注意根據(jù)對應(yīng)版本下載 pip install + whl文件地址 接下來就可以使用啦,給出兩個小栗子

    2024年02月07日
    瀏覽(19)
  • SSL certificate problem: unable to get local issuer certificate解決辦法

    SSL certificate problem: unable to get local issuer certificate解決辦法

    在github上用https克隆代碼時報了如下錯誤 這是由于當(dāng)你通過HTTPS訪問Git遠(yuǎn)程倉庫的時候,如果服務(wù)器上的SSL證書未經(jīng)過第三方機(jī)構(gòu)認(rèn)證,git就會報錯。原因是因?yàn)槲粗臎]有簽署過的證書意味著可能存在很大的風(fēng)險。解決辦法就是通過下面的命令將git中的sslverify關(guān)掉: 然后在

    2024年02月11日
    瀏覽(30)
  • Git SSL certificate problem: unable to get local issuer certificate

    錯誤: ?? ?Push failed ?? ??? ??? ?Unable to access \\\'https://github.com/ttsin/gitTest.git/\\\': SSL certificate problem: unable to get local issuer certificate 你在遠(yuǎn)程訪問GitHub時,出現(xiàn) 這個錯誤通常表示Git無法驗(yàn)證GitHub的SSL證書,因?yàn)槿鄙俦镜仡C發(fā)機(jī)構(gòu)(CA)的根證書。 方法一: 1. 更新Git的CA證書:

    2024年02月14日
    瀏覽(74)
  • Mac下certificate verify failed: unable to get local issuer certificate

    Mac下certificate verify failed: unable to get local issuer certificate

    出現(xiàn)這個問題,可以安裝證書 在finder中查找 Install Certificates.command 找到后雙擊,或者使用其他終端打開 安裝完即可

    2024年02月15日
    瀏覽(27)
  • 已解決unable to access ‘https://github.com/**‘: SSL certificate problem: unable to get

    錯誤:unable to access \\\'https://github.com/\\\': SSL certificate problem: unable to get local issuer certificate 這個問題是由于沒有配置信任的服務(wù)器HTTPS驗(yàn)證。默認(rèn),curl被設(shè)為不信任任何CAS,就是說,它不信任任何服務(wù)器驗(yàn)證。 只需要執(zhí)行下面命令就可以解決: ?

    2024年03月19日
    瀏覽(88)
  • How to disable certificate validations in the Java HTTP Client

    Java 11 introduced the?HTTP Client, an API that made it easier to send HTTP requests with vanilla Java. By default, it throws an exception if there are certificate path or hostname verification errors in the request. Let’s see how to bypass certificate validations for cases where this is really necessary. To ignore both certificate path and hostname verif

    2024年01月19日
    瀏覽(17)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包