安全加载数据源时出错。解密数据时发生错误

时间:2018-11-18 10:51:28

标签: encryption wso2 datasource esb

我知道一个类似的问题已经问过here,但由于给出的答案没有帮助我,我的问题有点不同,所以我要问一个新问题。

我通过admin panel -> Configure -> Datasources创建数据源,并且工作正常。但是,如果我重新启动服务器,则所有创建的 Datasources 都将从数据源列表中丢失。

当我运行 ESB 服务器时,通过日志可以看到那些数据源无法正确加载,因为ESB服务器无法解密之前加密的敏感数据:

  

DataSourceRepository在路径'/repository/components/org.wso2.carbon.ndatasource/myDatasource处更新数据源[remove:false]时出错

     

从注册表更新数据源“ myDatasource”时出错   [remove:false]:安全加载数据源时出错

     

元信息:解密数据时发生错误

尽管数据源列表中缺少 myDatasource ,但我仍可以通过admin panel -> Registry -> /_system/config/repository/components/org.wso2.carbon.ndatasource/myDatasource在注册表中看到它

1 个答案:

答案 0 :(得分:1)

我有同样的问题。这似乎是6.4.0中引入的一些错误。
6.3.0没有表现出这种行为。

作为一种解决方法,如果您在 /conf/datasources/master-datasources.xml 中定义数据源,则在服务器启动时会正确加载数据源。但是,这不是理想的解决方案,因为它们随后无法通过Web控制台进行编辑。

或者,您可以下载注册表项,编辑密码元素以删除“ Encrypted = true”,然后将密码更改为未加密。然后,将编辑后的文件作为旧注册表项的新注册表项上传。

这两种方法都无法进行生产,因为它们保留了未加密的密码。

出于兴趣,您是否正在Windows上运行它?我还在EI 6.4.0上发现Ciphertool实用程序由于路径格式不正确而无法运行。我怀疑这可能是相关的,但我无法找到格式错误的路径的出处,它似乎是在路径内重复{carbon.home}元素:

    C:\Program Files\WSO2\Enterprise Integrator\6.4.0\bin>ciphertool
Using CARBON_HOME:   C:\Program Files\WSO2\Enterprise Integrator\6.4.0
Using JAVA_HOME:    C:\WSO2\Enterprise Integrator\6.3.0\jdk\jdk1.8.0_192
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 51: C:\Program Files\WSO2\Enterprise Integrator\6.4.0\C:\Program Files\WSO2\Enterprise Integrator\6.4.0\/repository/resources/security/wso2carbon.jks
        at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at java.nio.file.Paths.get(Paths.java:84)
        at org.wso2.ciphertool.utils.Utils.getConfigFilePath(Utils.java:98)
        at org.wso2.ciphertool.utils.Utils.setSystemProperties(Utils.java:289)
        at org.wso2.ciphertool.CipherTool.initialize(CipherTool.java:93)
        at org.wso2.ciphertool.CipherTool.main(CipherTool.java:52)