2016-12-29 62 views

回答

2

你可以使用openssl來提取服務器的公鑰。

  1. 啓動服務器

  2. 執行命令 「的OpenSSL的s_client.First -connect:」 例如OpenSSL的的s_client.First -connect本地主機:8243

  3. 複製證書(BEGIN CERTIFICATE到END CERTIFICATE)從結果

----- BEGIN CERTIFICATE ----- MIICNTCCAZ6gAwIBAgIES343gj ANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJV UzELMAkGA1UECAwCQ0ExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxDTALBgNVBAoM BFdTTzIxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xMDAyMTkwNzAyMjZaFw0zNTAy MTMwNzAyMjZaMFUxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwN TW91bnRhaW4gVmlldzENMAsGA1UECgwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCUp/oV1vWc8/TkQSiAvTousMzO M4asB2iltr2QKozni5aVFu818MpOLZIr8LMnTzWllJvvaA5RAAdpbECb + 48FjbBe 0hseUdN5HpwvnH/DW8ZccGvk53I6Orq7hLCv1ZHtuOCokghz/ATrhyPq + QktMfXn RS4HrKGJTzxaCcU7OQIDAQABoxIwEDAOBgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcN AQEFBQADgYEAW5wPR7cr1LAdq + IrR44iQlRG5ITCZXY9hI0PygLP2rHANh + PYfTm xbuOnykNGyhM6FjFLbW2uZHQTY1jMrPprjOrmyK5sjJRO4d1DeGHT /炔Ijs9JogR Kv4XHECwLtIVdAbIdWHEtVZJyMSktcyysFcvuhPQK8Qc/E/Wq8uHSCo = ----- END CERTIFICATE -----

  • 打開/etc/ssl/certs/ca-certificates.crt和追加在步驟3中檢索到的證書內容
  • +0

    爲什麼它是「localhost:8243」?那麼爲什麼API控制檯會生成 ip「https://172.17.0.1」? – mike

    3

    <APIM_HOME>/repository/resources/security/上運行此命令。這將創建一個證書文件wso2.crt

    keytool -export -alias wso2carbon -file wso2.crt -keystore wso2carbon.jks 
    

    默認密鑰庫的密碼是wso2carbon

    相關問題