首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WSO2是:更改HTTPS证书

WSO2是:更改HTTPS证书
EN

Stack Overflow用户
提问于 2015-10-21 07:39:43
回答 1查看 4.4K关注 0票数 3

我是WSO2配置方面的新手,也是HTTPS证书工作方式方面的相对新手,所以请原谅我。

我试图在WSO2中更改HTTPS连接的证书。如果没有任何配置,WSO2将返回一个带有DN CN = localhost,O = WSO2,L = Mountain View,ST = CA,C = US的证书。我正试图按照这篇博客文章的说明,用自己的证书来更改这一点。

我在keystore中导入了我的证书,并如本文所述更改了配置。一个值得注意的区别是我找不到${carbon.home}/repository/conf/mgt-transports.xml

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

KeyStore和RegistryKeyStore条目在repository/conf/carbon.xml

代码语言:javascript
复制
   <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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-21 12:55:04

步骤1:使用私钥和公钥(密钥对)创建一个新的密钥存储库.内部/存储库/资源/安全/目录。默认的密钥存储库(wso2carbon.jks)和信任库(client-信任库. The )将存储在这里。

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

·Keystore/密钥对应该具有以下属性/属性:

代码语言:javascript
复制
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

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

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

·将证书从Keystore导出(步骤1)到信任库

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

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

代码语言:javascript
复制
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

或多或少,只需搜索文件中的"jks“即可。

删除旧的密钥存储库

Step4:重新启动

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33253567

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档