У меня проблема с авторизованным SSL-соединением. Я создал Struts Action, который подключается к внешнему серверу с помощью SSL-сертификата, авторизованного клиентом. В моем действии я пытаюсь отправить некоторые данные на сервер банка, но безуспешно, потому что в результате сервера у меня возникает следующая ошибка:
error: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
Мой метод из моего класса действия, который отправляет данные на сервер
//Getting external IP from host
URL whatismyip = new URL("http://automation.whatismyip.com/n09230945.asp");
BufferedReader inIP = new BufferedReader(new InputStreamReader(whatismyip.openStream()));
String IPStr = inIP.readLine(); //IP as a String
Merchant merchant;
System.out.println("amount: " + amount + ", currency: " + currency + ", clientIp: " + IPStr + ", description: " + description);
try {
merchant = new Merchant(context.getRealPath("/") + "merchant.properties");
} catch (ConfigurationException e) {
Logger.getLogger(HomeAction.class.getName()).log(Level.INFO, "message", e);
System.err.println("error: " + e.getMessage());
return ERROR;
}
String result = merchant.sendTransData(amount, currency, IPStr, description);
System.out.println("result: " + result);
return SUCCESS;
Мой продавец. файл свойств:
bank.server.url=https://-servernameandport-/
https.cipher=-cipher-
keystore.file=-key-.jks
keystore.type=JKS
keystore.password=-password-
ecomm.server.version=2.0
encoding.source=UTF-8
encoding.native=UTF-8
Впервые я подумал, что это проблема с сертификатом, я преобразовал его из .pfx в .jks, но у меня та же ошибка, без изменений.