encryption - 安全加载数据源时出错。解密数据时出错

标签 encryption wso2 datasource esb

我知道有人问过类似的问题 here但由于给出的答案对我没有帮助,而且我的问题有点不同,所以我在问一个新问题。

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

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

DataSourceRepository Error in updating data source [remove:false] at path '/repository/components/org.wso2.carbon.ndatasource/myDatasource

Error in updating data source 'myDatasource' from registry [remove:false]: Error in secure load of data source

meta info: An error occurred while decrypting data

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

最佳答案

我也有同样的问题。这似乎是 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)

关于encryption - 安全加载数据源时出错。解密数据时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53360049/

相关文章:

c# - 如何以加密形式上传文件

ssl - PKIX 路径构建失败 : sun. security.provider.certpath.SunCertPathBuilderException

java - 创建名称为 'batchDataSource' : Requested bean is currently in creation: Is there an unresolvable circular reference? 的 bean 时出错

c++ - 对逆向工程隐藏字符数组

Caesar Cipher c 程序不接受

wso2 - 通过 WSO2 API 管理器公开不安全的 url

wso2: cep: siddhi: 如何使时间窗口持久化

C# 从 MySQL 更新 DataGridView/DataSource

java - 在 Spring Boot 中使用两个数据源

encryption - 使用 secret 共享方案保护 2048 位 RSA 私钥的实现