1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Liberty経由でWatson APIを呼び出す際SSLエラーの対策

Posted at

Eclipseのコンソールログから下記エラーが出た際の対策

前提環境

Liberty with Full Platform導入済み

エラー

[ERROR   ] 
CWPKI0022E: SSL ハンドシェークの失敗: 
SubjectDN CN=*.watsonplatform.net, O=INTERNATIONAL BUSINESS MACHINES CORPORATION, L=Armonk, ST=New York, C=US の署名者がターゲット・ホストから送信されました。 
 SSL 構成別名 defaultSSLConfig にあるローカル・トラストストア 
<root directory>/Liberty_JavaEE7_Full/usr/servers/Server01/resources/security/key.jks にこの署名者を追加する必要がある可能性があります。  
SSL ハンドシェーク例外から送られた拡張エラー・メッセージは次のとおりです: 
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

解決方法①

最初からLiberty with IBM Java SDK8を導入する。
そうするとそのエラーが出なくなる。

やっぱ入れ直しが時間かかるし面倒だと思う人は次の方法へ。

解決方法②

・証明書入手
手順参考:https://qiita.com/nenokido2000/items/b36b6e5f0854d7d63ba6
Downloadされた証明書:*watsonplatformnet.cer

・下記コマンド実行
(JAVA EE環境)

sudo keytool -import -alias <証明書別名> -keystore <root directory>/Liberty_JavaEE7_Full/usr/servers/Server01/resources/security/key.jks -file <root directory>/Desktop/\*watsonplatformnet.cer

場合によってはJava向け下記も実行しておく必要がある

sudo keytool -import -alias <証明書別名> -keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/security/cacerts -file <root directory>/Desktop/\*watsonplatformnet.cer
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?