如何为apache-tomcat-9.0.74加密JDBC密码?

huangapple go评论76阅读模式
英文:

How to encrypt JDBC password for apache-tomcat-9.0.74?

问题

JDBC密码解密对于apache-tomcat-9.0.74使用SecureTomcatJDBC.jar不起作用。需要什么解决方法?

我按照https://www.aivhub.com/wiki/aiv_secureJDBCpassword.html中提供的步骤进行操作。
我使用命令"java -jar SecureTomcatJDBC.jar password"生成了加密的密码。
然后,我将SecureTomcatJDBC.jar放置在Tomcat的lib目录中。

<Resource name="jdbc/PegaRULES"
auth="Container"
type="javax.sql.DataSource"
factory="SecureTomcatDataSourceImpl"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://db1.rds.amazonaws.com:5432/dbdev"
username="pegaadmin"
password="b67720a6c39db763b7f"
maxActive="100"
maxIdle="30"
maxWait="60000"
connectionProperties=""
validationQuery="SELECT 1"
validationInterval="30000"
testWhileIdle="true"
timeBetweenEvictionRunsMills="10000"
/>

密码解密适用于apache-tomcat-9.0.73,但对于apache-tomcat-9.0.74则不适用。

英文:

Decryption of JDBC Password for Tomcat not working for apache-tomcat-9.0.74 using SecureTomcatJDBC.jar. What should be the work around?

I followed the steps provided in https://www.aivhub.com/wiki/aiv_secureJDBCpassword.html.
I generated the encrypted password using the command "java -jar SecureTomcatJDBC.jar password".
Then I placed the SecureTomcatJDBC.jar in the lib of Tomcat.

&lt;Resource name=&quot;jdbc/PegaRULES&quot;
          auth=&quot;Container&quot;
          type=&quot;javax.sql.DataSource&quot;
          factory=&quot;SecureTomcatDataSourceImpl&quot;
          driverClassName=&quot;org.postgresql.Driver&quot;
          url=&quot;jdbc:postgresql://db1.rds.amazonaws.com:5432/dbdev&quot;
          username=&quot;pegaadmin&quot;
          password=&quot;b67720a6c39db763b7f&quot;
          maxActive=&quot;100&quot;
          maxIdle=&quot;30&quot;
          maxWait=&quot;60000&quot;
          connectionProperties=&quot;&quot;
          validationQuery=&quot;SELECT 1&quot;
          validationInterval=&quot;30000&quot;
          testWhileIdle=&quot;true&quot;
          timeBetweenEvictionRunsMills=&quot;10000&quot;
          /&gt;

The decryption of password is working for apache-tomcat-9.0.73, but the same is not working apache-tomcat-9.0.74.

答案1

得分: 0

The issue is not due to the versions of JDK and Tomcat.
问题不是由于JDK和Tomcat的版本。

It was found that the actual password of pegaadmin started with $ character. So the password of pegaadmin was changed by the DBA and the new password now starts with c.
发现pegaadmin的实际密码以$字符开头。因此,DBA更改了pegaadmin的密码,新密码现在以c开头。

This password was encrypted by the command "java -jar SecureTomcatJDBC.jar c*******" and the new encrypted password was put into the context.xml file.
此密码通过命令"java -jar SecureTomcatJDBC.jar c*******"进行加密,然后将新加密的密码放入context.xml文件中。

With the new password, the decryption by Tomcat was successful and the issue is resolved.
使用新密码,Tomcat成功解密,问题已解决。

So, this is a bug of the SecureTomcatJDBC.jar file.
因此,这是SecureTomcatJDBC.jar文件的一个错误。

英文:

The issue is not due to the versions of JDK and Tomcat.
It was found that the actual password of pegaadmin started with $ character. So the password of pegaadmin was changed by the DBA and the new password now starts with c.
This password was encrypted by the command "java -jar SecureTomcatJDBC.jar c*******" and the new encrypted password was put into the context.xml file.

With the new password the decryption by Tomcat was successful and the issue is resolved.

So, this is a bug of the SecureTomcatJDBC.jar file.

huangapple
  • 本文由 发表于 2023年5月21日 23:29:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76300648.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定