WSO2 IS:更改HTTPS证书

Dum*_*tru 3 https wso2 ssl-certificate

我是WSO2配置的新手,还是HTTPS证书如何工作的相对新手,所以请耐心等待。

我正在尝试更改WSO2中HTTPS连接的证书。没有任何配置,WSO2将返回带有DN的证书CN = localhost,O = WSO2,L = Mountain View,ST = CA,C = US。我试图按照本博客文章中的说明使用自己的证书对此进行更改。

我已将我的证书导入到密钥库中,并按照文章中所述更改了配置。一个显着的区别是我找不到${carbon.home}/repository/conf/mgt-transports.xml

完成此操作后,连接到IS服务器管理服务将导致返回“ localhost”证书,而不是导入的证书。

中的KeyStore和RegistryKeyStore条目 repository/conf/carbon.xml

   <KeyStore>                                                              
        <!-- Keystore file location-->                                      
        <Location>${carbon.home}/repository/resources/security/wso2carbon.jks</Location>
        <!-- Keystore type (JKS/PKCS12 etc.)-->                             
        <Type>JKS</Type>                                                    
        <!-- Keystore password-->                                           
        <Password>wso2carbon</Password>                                     
        <!-- Private Key alias-->                                           
        <KeyAlias>testcert</KeyAlias>                                       
        <!-- Private Key password-->                                        
        <KeyPassword>wso2carbon</KeyPassword>                               
    </KeyStore>                                                             

     <!--                                                                   
        Encrypt Decrypt Store will be used for encrypting and decrypting       
    -->                                                                     
    <RegistryKeyStore>                                                      
        <!-- Keystore file location-->                                      
        <Location>${carbon.home}/repository/resources/security/wso2carbon.jks</Location>
        <!-- Keystore type (JKS/PKCS12 etc.)-->                             
        <Type>JKS</Type>                                                    
        <!-- Keystore password-->                                           
        <Password>wso2carbon</Password>                                     
        <!-- Private Key alias-->                                           
        <KeyAlias>testcert</KeyAlias>                                       
        <!-- Private Key password-->                                        
        <KeyPassword>wso2carbon</KeyPassword>                               
    </RegistryKeyStore>
Run Code Online (Sandbox Code Playgroud)

小智 6

步骤1:使用私钥和公钥(密钥对)创建一个新的密钥库。在/ repository / resources / security /目录中。默认密钥库(wso2carbon.jks)和信任库(client-truststore.jks)将存储在此处。

•使用Java密钥工具(包含在标准jdk中)创建一个包含密钥对的密钥库,并将其保存为jks文件。密钥库包含此服务器的密钥对(公用和专用密钥)。

•密钥库/密钥对应具有以下属性/属性:

KeystoreType = JKS,
KeyPairAlgorithm = RSA,
Size = 2048 bits
SignatureAlgorithm = SHA-256 WITH RSA
Password    (Must be exactly the same as the keystore password)
Name(Subject):  The CN(Common Name) of the key-pair should be the server’s hostname upon which the IS will be deployed (if you intend to use it as the key manager for api manager)
Extensions:
Key usage : Digital Signature , Key Encipherment , Data Encipherment , on Repudian
Subject Alternate name : IP address = IP address of this server
Run Code Online (Sandbox Code Playgroud)

步骤2:将证书链从步骤1中创建的密钥库导入到信任库中。

创建具有相同属性的新信任库

•将证书从密钥库(步骤1)导出到信任库中

步骤3:按如下所示更改配置文件,以反映刚刚创建的新密钥库和信任库。

更改以下文件(在/ repository / conf /中)的适当值:

File                            Line number/s
identity.xml                    180
carbon.xml                      310
                                326
                                343
axis2/axis2_pt.xml              272
                                280
                                396
                                404
axis2/axis2.xml                 272
                                280
                                396
                                404
axis2/axis2_nhttp.xml           278
                                286
                                405
                                413
security/secret-conf.properties 21
                                30
sec.policy                      1
Run Code Online (Sandbox Code Playgroud)

或多或少,只需在文件中搜索“ jks”

删除旧的密钥库

步骤4:重新启动