2012-03-15 7 views
1

HibernateからRDSインスタンスに安全に接続しようとしています。私のhibernate.cfgファイルの関連するプロパティは次のようになります。HibernateでMySQL RDSでSSLを有効にする

<property name="connection.url"> 
      jdbc:mysql://<endpoint>/<db>?autoReconnect=true&amp;useUniCode=true&amp;characterEncoding=UTF-8&amp;useSSL=true  
</property> 
<property name="dialect"> org.hibernate.dialect.MySQLDialect </property>  
<property name="connection.verifyServerCertificate">false</property> 
<property name="connection.requireSSL">true</property> 

しかし、次の例外が発生しています。

Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 

RDSインスタンスにも何か設定する必要がありますか?

おかげで、

答えて

0

私はこの問題を解決することができましたが、まだ根本的な原因を知りません。

何らかの形でこれらの接続プロパティを別々に追加しても機能しませんでしたが、接続URLのパラメータとして追加したときに機能しました。

jdbc:mysql://<endpoint>/<db>?autoReconnect=true&useUniCode=true&characterEncoding=UTF-8&useSSL=true&verifyServerCertificate=false&requireSSL=true