Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WSO2 EI-2路SSL-握手失败_Ssl_Wso2_Esb_Handshake_Ei - Fatal编程技术网

WSO2 EI-2路SSL-握手失败

WSO2 EI-2路SSL-握手失败,ssl,wso2,esb,handshake,ei,Ssl,Wso2,Esb,Handshake,Ei,我在设置双向SSL身份验证时遇到问题。 我需要从wso2 Enterprise integrator访问HTTPS端点。 服务提供商给了我一个pfx密钥库,其中包含我必须提供给服务器的证书和私钥 我在windows计算机上安装了这个pfx密钥库,并尝试从Chrome访问端点(端点在根上下文中有一个GET服务,返回hello消息)。访问此端点时,chrome会告诉我选择要提供给服务器的证书。。。我选择了一个好的,并返回hello消息。。。好的,证书有效 我也尝试了curl,提供了key、cacer

我在设置双向SSL身份验证时遇到问题。 我需要从wso2 Enterprise integrator访问HTTPS端点。 服务提供商给了我一个pfx密钥库,其中包含我必须提供给服务器的证书和私钥

我在windows计算机上安装了这个pfx密钥库,并尝试从Chrome访问端点(端点在根上下文中有一个GET服务,返回hello消息)。访问此端点时,chrome会告诉我选择要提供给服务器的证书。。。我选择了一个好的,并返回hello消息。。。好的,证书有效

我也尝试了curl,提供了key、cacert和cert(使用openssl从pfx文件中提取)。一切都很顺利

问题是当我尝试从wso2 ei服务访问此端点时。 我使用keytool按照以下步骤将我的pfx文件导入默认密钥库(wso2carbon.jks):

  • 在jks中导入pfx

    keytool-importkeystore-srckeystore.pfx-srcstoretype pkcs12-destkeystore wso2carbon.jks-deststoretype jks-srcstorepass-deststorepass wso2carbon

  • 导出jks公钥

    keytool-export-alias”“-keystore wso2carbon.jks-file publickey.pem-storepass wso2carbon

  • 在默认的client-trustore.jks中导入公钥

    keytool-import-alias”“-文件publickey.pem-keystore-client-truststore.jks-storepass wso2carbon

  • 更新wso2carbon密钥库中别名的密码(必须与jks pwd相同)

    keytool-keypasswd-alias”“-new wso2carbon-keystore wso2carbon.jks-keypass-storepass wso2carbon

  • 向trustore添加了根服务器和中间服务器证书

    keytool-import-v-trustcacerts-alias root-file root.cer-keystore client-truststore.jks-storepass wso2carbon keytool-import-v-trustcacerts-alias intermed-file intermed.cer-keystore client-truststore.jks-storepass wso2carbon

  • 重新启动WSO2 EI,然后尝试访问终结点(握手失败!!!)

    我激活了错误跟踪下面的-Djavax.net.debug=ssl:handshake。 WSO2 EI似乎找不到服务器请求的证书

    ...
    *** CertificateRequest
    Cert Types: RSA, DSS, ECDSA
    Supported Signature Algorithms: SHA512withRSA, Unknown (hash:0x6, signature:0x2), SHA512withECDSA, SHA384withRSA, Unknown (hash:0x5, signature:0x2), SHA384withECDSA, SHA256withRSA, Unknown (hash:0x4, signature:0x2), SHA256withECDSA, SHA224withRSA, Unknown (hash:0x3, signature:0x2), SHA224withECDSA, SHA1withRSA, SHA1withDSA, SHA1withECDSA
    Cert Authorities:
    <CN=Autorite Bureau RTE, O=RTE, L=Pacy, ST=Eure, C=FR>
    <CN=Autorite Racine RTE, O=RTE, L=Pacy, ST=Eure, C=FR>
    <CN=Autorite Bureau Machine RTE, DC=bureau, DC=si, DC=interne>
    *** ServerHelloDone
    Warning: no suitable certificate found - continuing without client authentication
    *** Certificate chain
    <Empty>
    ***
    *** ClientKeyExchange, RSA PreMasterSecret, TLSv1.2
    PassThroughMessageProcessor-2, WRITE: TLSv1.2 Handshake, length = 320
    SESSION KEYGEN:
    PreMaster Secret:
    ... no IV derived for this protocol
    PassThroughMessageProcessor-2, WRITE: TLSv1.2 Change Cipher Spec, length = 64
    *** Finished
    verify_data:  { 111, 185, 151, 74, 99, 156, 152, 185, 240, 222, 162, 116 }
    ***
    PassThroughMessageProcessor-2, WRITE: TLSv1.2 Handshake, length = 80
    PassThroughMessageProcessor-2, READ: TLSv1.2 Alert, length = 64
    PassThroughMessageProcessor-2, RECV TLSv1.2 ALERT:  fatal, handshake_failure
    %% Invalidated:  [Session-1, TLS_RSA_WITH_AES_256_CBC_SHA256]
    %% Invalidated:  [Session-2, TLS_RSA_WITH_AES_256_CBC_SHA256]
    PassThroughMessageProcessor-2, called closeSocket()
    PassThroughMessageProcessor-2, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    PassThroughMessageProcessor-2, called close()
    PassThroughMessageProcessor-2, called closeInternal(true)
    
    。。。
    ***证书申请
    证书类型:RSA、DSS、ECDSA
    支持的签名算法:SHA512 WithRSA,Unknown(散列:0x6,签名:0x2),SHA512 WithECDSA,SH384WithRSA,Unknown(散列:0x5,签名:0x2),SHA384 WithECDSA,SHA256 WithRSA,Unknown(散列:0x3,签名:0x2),SHA224 WithECDSA,SHA1 WithRSA,SHA1 WithDSA,SHA1 WithECDSA
    核证机关:
    ***海龙石
    警告:找不到合适的证书-在没有客户端身份验证的情况下继续
    ***证书链
    ***
    ***ClientKeyExchange,RSA PreMasterSecret,TLSv1.2
    PassThroughMessageProcessor-2,WRITE:TLSv1.2握手,长度=320
    会话密钥:
    毕业前的秘密:
    ... 本协议未衍生IV
    PassThroughMessageProcessor-2,WRITE:TLSv1.2更改密码规范,长度=64
    ***完成
    验证数据:{111、185、151、74、99、156、152、185、240、222、162、116}
    ***
    PassThroughMessageProcessor-2,WRITE:TLSv1.2握手,长度=80
    PassThroughMessageProcessor-2,读取:TLSv1.2警报,长度=64
    PassThroughMessageProcessor-2,RECV TLSv1.2警报:致命,握手失败
    %%无效:[会话1,TLS\U RSA\U与\U AES\U 256\U CBC\U SHA256]
    %%无效:[会话2,TLS\U RSA\U与\U AES\U 256\U CBC\U SHA256]
    PassThroughMessageProcessor-2,称为closeSocket()
    PassThroughMessageProcessor-2,处理异常:javax.net.ssl.SSLHandshakeException:收到致命警报:握手失败
    PassThroughMessageProcessor-2,称为close()
    PassThroughMessageProcessor-2,称为closeInternal(true)
    
    我尝试使用soapui,引用先前创建的密钥库,GET调用返回hello消息(握手成功)

    我还尝试了一个使用该密钥库的片段java类,ssl握手过程进展顺利

    System.setProperty("javax.net.ssl.keyStore", keystorePath);
            System.setProperty("javax.net.ssl.keyStorePassword", CERT_PASSWORD);
            System.setProperty("javax.net.ssl.keyStoreType", "JKS");
            URL myUrl;
            try {
                myUrl = new URL(endpoint);
                HttpsURLConnection conn = (HttpsURLConnection) myUrl.openConnection();
                InputStream is = conn.getInputStream();
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
    
                String inputLine;
    
                while ((inputLine = br.readLine()) != null) {
                    System.out.println(inputLine);
                }
    
    Cert Authorities:
    <CN=Autorite Bureau RTE, O=RTE, L=Pacy, ST=Eure, C=FR>
    <CN=Autorite Racine RTE, O=RTE, L=Pacy, ST=Eure, C=FR>
    <CN=Autorite Bureau Machine RTE, DC=bureau, DC=si, DC=interne>
    *** ServerHelloDone
    matching alias: alias-cert
    
    System.setProperty(“javax.net.ssl.keyStore”,keystorePath);
    setProperty(“javax.net.ssl.keystrepassword”,证书密码);
    setProperty(“javax.net.ssl.keyStoreType”、“JKS”);
    URL-myUrl;
    试一试{
    myUrl=新URL(端点);
    HttpsURLConnection conn=(HttpsURLConnection)myUrl.openConnection();
    InputStream is=conn.getInputStream();
    InputStreamReader isr=新的InputStreamReader(is);
    BufferedReader br=新的BufferedReader(isr);
    字符串输入线;
    而((inputLine=br.readLine())!=null){
    系统输出打印LN(输入线);
    }
    核证机关:
    ***海龙石
    匹配别名:别名证书
    
    谢谢你的帮助。 谢谢

    亲切问候,,
    Rudy

    您是否浏览了链接Hello,是的,我看过了,除了我注意到创建了一个新的jks。我更喜欢在wso2carbon default one中导入它,以保存所有要更新的xml配置文件。您是否可以尝试在client-truststore.jks文件中导入这些证书,因为它们是wso2产品不使用的证书,所以我觉得这是一个第三方证书,因此它在client-truststore.jks中查找。您好,我尝试了很多东西,包括您提到的,但都没有成功…我还更新了wso2ei,仅将wso2carbon.jks用作信任库和密钥库,以简化我的测试…顺便说一句,我编写了一个小java类(独立,不使用wso2产品),ssl过程进展顺利,客户端找到了有关服务器证书请求的适当证书…wso2配置中似乎存在问题,但找不到位置