0
私はwso2 sso version 5.3
を使用しています。私はwso2carbon.jks
の代わりに新しいjks
キーを設定し、手順に従います。 ${carbon.home}/repository/resources/security/test2.jks
コマンドをフォルダに自己-signed証明書とコピーされたキーを使用して、鍵生成wso2キーストア問題
:
- keytool -genkey -keyalg RSA -alias wso2carbon -keystore keystore.jks -validity 360
- 更新
新しい
test2.jks
ファイルと新しいcarbon.xml
。<KeyStore> <!-- Keystore file location--> <Location>${carbon.home}/repository/resources/security/test2.jks</Location> <!-- Keystore type (JKS/PKCS12 etc.)--> <Type>JKS</Type> <!-- Keystore password--> <Password>xxxxxx</Password> <!-- Private Key alias--> <KeyAlias>wso2carbon</KeyAlias> <!-- Private Key password--> <KeyPassword>xxxxxx</KeyPassword> </KeyStore>
エラーメッセージ:
例外軸2ライブラリを使用してJavaから呼び出し中。 "sun.security.provider.certpath.SunCertPathBuilderException:要求されたターゲットへの有効な証明書パスを見つけることができません"。
コードスニペット:
public static void main (String[] args) throws Exception {
final String SERVER_URL = "https://XXXXXXX:9443/services/";
//setting jks key
System.setProperty("javax.net.ssl.trustStore", "test2.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "XXXXX");
System.setProperty("javax.net.ssl.trustStoreType", "JKS");
try{
String cookie = null;
AuthenticationAdminStub authstub = new AuthenticationAdminStub(SERVER_URL+"AuthenticationAdmin");
// Authenticates as a user having rights to add users.
if (authstub.login(XXXXXX, XXXXXX, null)) {
cookie = (String) authstub._getServiceClient().getServiceContext().getProperty(
HTTPConstants.COOKIE_STRING);
System.out.println("cookie "+cookie);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
}
スタックトレース:
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 42 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
... 48 more