powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Java [игнор отключен] [закрыт для гостей] / Соединение с сервисом с помощью p.12
4 сообщений из 4, страница 1 из 1
Соединение с сервисом с помощью p.12
    #37971051
mkfjava
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
TrustStore сгенерировал с помощью InstallCert.java
KeyStore (.p12) получил от WebService провайдера.

Код: java
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
	

System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
System.setProperty("javax.net.ssl.trustStoreType", "jks");

System.setProperty("javax.net.ssl.keyStore", "C:\\keydir\\rnr.p12");
System.setProperty("javax.net.ssl.keyStorePassword", "test");
System.setProperty("javax.net.ssl.trustStore", "C:\\keydir\\jssecacerts");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

final SSLSocketFactory ssf = (SSLSocketFactory) SSLSocketFactory.getDefault();



Exceptioncom.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 401: Unauthorized
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCode(HttpTransportPipe.java:296)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:245)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:203)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:122)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:123)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:626)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:585)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:570)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:467)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:308)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:146)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:129)
at $Proxy38.read(Unknown Source)
at net.ageto.aecc.in.sap.impl.ProductImportImpl.getPriceList(ProductImportImpl.java:87)
at net.ageto.gyrex.impex.aecc.steps.importer.ProductImport.process(ProductImport.java:52)
at net.ageto.gyrex.impex.impl.BaseProcessStep.run(BaseProcessStep.java:59)
at net.ageto.gyrex.impex.impl.internal.ImpexProcessStepRunEnvironment.runProcessStep(ImpexProcessStepRunEnvironment.java:61)
at net.ageto.gyrex.impex.impl.launch.ImpexProcessLauncher.launch(ImpexProcessLauncher.java:123)
at net.ageto.gyrex.impex.aecc.test.TestAeccImpexProcess.sapProductImport(TestAeccImpexProcess.java:384)
at net.ageto.gyrex.impex.aecc.test.TestAeccImpexProcess.myTests(TestAeccImpexProcess.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
...
Рейтинг: 0 / 0
Соединение с сервисом с помощью p.12
    #37971091
mkfjava
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Дело в том что с прежним p12 этот метод работал, а с новым нет. Также с прежним p12 получалось в прямую подключится к WebService через SOAP UI, а с новым p12 в прямую подключится нельзя, но можно если извлечь .pem сертификат и подать его как keystore для SOAP UI.
...
Рейтинг: 0 / 0
Соединение с сервисом с помощью p.12
    #37971232
mkfjava
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Получилось подсоединится когда с помощью openssl из .pem файла создал pkcs12 keystore. Работает но не знаю как. Кто нибудь мог бы объяснить ?

Код: java
1.
openssl pkcs12 -export -out keystore.pkcs12 -in testkey.pem -inkey testkey.pem
...
Рейтинг: 0 / 0
Соединение с сервисом с помощью p.12
    #37971471
mkfjava
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Ответ нашёл здесь

Ответ
...
Рейтинг: 0 / 0
4 сообщений из 4, страница 1 из 1
Форумы / Java [игнор отключен] [закрыт для гостей] / Соединение с сервисом с помощью p.12
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]