Добрый день!
Не получается установить соединение с сервером.
Клиент на Solaris.
JTLS и JCR установлены, сняты ограничения на длину ключей, новый корневой сертификат импортирован,
импортирован личный сертификат, создано хранилище ключей
Похоже контейнер и хранилище определяются, но сервер возвращает код 403
Может быть, кто-то сталкивался с такой проблемой, подскажите пожалуйста, в чем может быть причина.
Ниже фрагмент кода и лог.
sa = "https://сервер";
serverAddress = new URL(sa);
connection = null;
System.setProperty("javax.net.ssl.trustStoreType", "HDImageStore");
System.setProperty("javax.net.ssl.trustStore", "/путь/trust.store");
connection = (HttpsURLConnection)serverAddress.openConnection();
fp = "/путь";
FileInputStream fin = new FileInputStream(fp");
connection.setRequestMethod("POST");
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setReadTimeout(10000);
connection.setUseCaches(false);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; Charset=windows-1251");
connection.setRequestProperty("Content-Length", fin.available()) );
connection.connect();
DataOutputStream output = new DataOutputStream( connection.getOutputStream() );
int k;
do
{
k = fin.read();
if (k != -1) output.write(k);
}while (k != -1);
output.write(endBoundary.getBytes());
output.close();
fin.close();
file = new File("/путь");
if (!file.exists())
{ file.createNewFile(); }
fs = new FileOutputStream(file);
out = new BufferedOutputStream(fs);
int i;
while ((i = rd.read()) != -1)
{
out.write(i);
}
rd.close();
out.close();
fs.close();
connection.disconnect();
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: keyStore is :
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: keyStore type is :
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: keyStore provider is :
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: init keystore
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: defaultStoreProvider =
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO:
Mar 25, 2013 4:05:08 PM ru.CryptoPro.JCP.tools.Starter check
INFO: Loading JCP 1.0.54 36707
Mar 25, 2013 4:05:08 PM ru.CryptoPro.JCP.tools.Starter check
INFO: JCP loaded.
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: init keymanager of type GostX509
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.n <init>
WARNING: %% No appropriate keys for handshake
PATH: /var/opt/cprocsp/keys/infa9
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: trustStore is: /inform/storage/infa_shared_dev/sh_scr/CMA/out/UCB/cert/trust.store
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: trustStore type is : HDImageStore
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: trustStore provider is :
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: init truststore
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: init trustmanager of type GostX509
Mar 25, 2013 4:05:08 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: init context...
Mar 25, 2013 4:05:09 PM ru.CryptoPro.ssl.SSLContextImpl d
INFO: Context inited.
Subscriber!!!!!!!!!!!!!!!!!!!!!!!! =333
Mar 25, 2013 4:05:09 PM ru.CryptoPro.ssl.n a
WARNING: %% No alias is match
java.io.IOException: Server returned HTTP response code: 403 for URL: https://сервер
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1672)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1670)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1243)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at HTTPS_Ch.main(HTTPS_Ch.java:139)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://сервер
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at HTTPS_Ch.main(HTTPS_Ch.java:134)