JDeveloper cert issue
I am using JDeveloper 12c trying to connect to secure web service SSL.
I added my both certificates RootCA and intermediate into trusted store in my JAVA_HOME directory.
Check below my source code:
SSLSocketFactory sslSocketFactory = sslcontext.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
HttpsURLConnection httpsConn = (HttpsURLConnection)url.openConnection();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
String xmlInput = "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.gdsp.vodafone.com/">n" +
" <soapenv:Header>n" +
" <ws:gdspHeader>n" +
" <gdspCredentials>n" +
" <password>***</password>n" +
" <userId>zainmdw</userId>n" +
" </gdspCredentials>n" +
" </ws:gdspHeader>n" +
" </soapenv:Header>n" +
" <soapenv:Body>n" +
" <ws:submitReportRequest>n" +
" <reportName>" + reportname + "</reportName>n" +
" <reportFormat>XML</reportFormat>n" +
" <reportParameters>n" +
" <parameter>n" +
" <name>CUSTOMER_CODE</name>n" +
" <value>" + customer_code + "</value>n" +
" </parameter>n" +
" <parameter>n" +
" <name>PERIOD_START</name>n" +
" <value>" + period_start + "</value>n" +
" </parameter>n" +
" </reportParameters>n" +
" <notificationType>N</notificationType>n" +
" <notificationUser>zainmdw</notificationUser>n" +
" <reportPriority>1</reportPriority>n" +
" </ws:submitReportRequest>n" +
" </soapenv:Body>n" +
"</soapenv:Envelope>";
byte buffer = new byte[xmlInput.length()];
buffer = xmlInput.getBytes();
bout.write(buffer);
byte b = bout.toByteArray();
String SOAPAction =
"https://m2mprdapi.vodafone.com:11851/GDSPWebServices/ReportRequestService";
// Set the appropriate HTTP parameters.
httpsConn.setRequestProperty("Content-Length",
String.valueOf(b.length));
httpsConn.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
httpsConn.setRequestProperty("SOAPAction", "submitReportRequest");
httpsConn.setRequestMethod("POST");
httpsConn.setDoOutput(true);
httpsConn.setDoInput(true);
OutputStream out = httpsConn.getOutputStream();
And here is the trace:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
sun.security.ssl.Alerts.getSSLException(Alerts.java:192) StackTraceElement
sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) StackTraceElement
sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) StackTraceElement
sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) StackTraceElement
sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514) StackTraceElement
sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216) StackTraceElement
sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026) StackTraceElement
sun.security.ssl.Handshaker.process_record(Handshaker.java:961) StackTraceElement
sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) StackTraceElement
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) StackTraceElement
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) StackTraceElement
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) StackTraceElement
sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) StackTraceElement
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) StackTraceElement
sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) StackTraceElement
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) StackTraceElement
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) StackTraceElement
sa.zainksa.BusinessLogic.VF_APIs.SendSoapRequest(VF_APIs.java:149) StackTraceElement
sa.zain.mdwSessionEJBClient.main(mdwSessionEJBClient.java:49) StackTraceElement
I did a lot of research to get solution for this exception with no luck to have a solution.
Any one can help me please?
java ssl ssl-certificate x509certificate jdeveloper
add a comment |
I am using JDeveloper 12c trying to connect to secure web service SSL.
I added my both certificates RootCA and intermediate into trusted store in my JAVA_HOME directory.
Check below my source code:
SSLSocketFactory sslSocketFactory = sslcontext.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
HttpsURLConnection httpsConn = (HttpsURLConnection)url.openConnection();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
String xmlInput = "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.gdsp.vodafone.com/">n" +
" <soapenv:Header>n" +
" <ws:gdspHeader>n" +
" <gdspCredentials>n" +
" <password>***</password>n" +
" <userId>zainmdw</userId>n" +
" </gdspCredentials>n" +
" </ws:gdspHeader>n" +
" </soapenv:Header>n" +
" <soapenv:Body>n" +
" <ws:submitReportRequest>n" +
" <reportName>" + reportname + "</reportName>n" +
" <reportFormat>XML</reportFormat>n" +
" <reportParameters>n" +
" <parameter>n" +
" <name>CUSTOMER_CODE</name>n" +
" <value>" + customer_code + "</value>n" +
" </parameter>n" +
" <parameter>n" +
" <name>PERIOD_START</name>n" +
" <value>" + period_start + "</value>n" +
" </parameter>n" +
" </reportParameters>n" +
" <notificationType>N</notificationType>n" +
" <notificationUser>zainmdw</notificationUser>n" +
" <reportPriority>1</reportPriority>n" +
" </ws:submitReportRequest>n" +
" </soapenv:Body>n" +
"</soapenv:Envelope>";
byte buffer = new byte[xmlInput.length()];
buffer = xmlInput.getBytes();
bout.write(buffer);
byte b = bout.toByteArray();
String SOAPAction =
"https://m2mprdapi.vodafone.com:11851/GDSPWebServices/ReportRequestService";
// Set the appropriate HTTP parameters.
httpsConn.setRequestProperty("Content-Length",
String.valueOf(b.length));
httpsConn.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
httpsConn.setRequestProperty("SOAPAction", "submitReportRequest");
httpsConn.setRequestMethod("POST");
httpsConn.setDoOutput(true);
httpsConn.setDoInput(true);
OutputStream out = httpsConn.getOutputStream();
And here is the trace:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
sun.security.ssl.Alerts.getSSLException(Alerts.java:192) StackTraceElement
sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) StackTraceElement
sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) StackTraceElement
sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) StackTraceElement
sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514) StackTraceElement
sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216) StackTraceElement
sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026) StackTraceElement
sun.security.ssl.Handshaker.process_record(Handshaker.java:961) StackTraceElement
sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) StackTraceElement
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) StackTraceElement
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) StackTraceElement
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) StackTraceElement
sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) StackTraceElement
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) StackTraceElement
sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) StackTraceElement
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) StackTraceElement
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) StackTraceElement
sa.zainksa.BusinessLogic.VF_APIs.SendSoapRequest(VF_APIs.java:149) StackTraceElement
sa.zain.mdwSessionEJBClient.main(mdwSessionEJBClient.java:49) StackTraceElement
I did a lot of research to get solution for this exception with no luck to have a solution.
Any one can help me please?
java ssl ssl-certificate x509certificate jdeveloper
add a comment |
I am using JDeveloper 12c trying to connect to secure web service SSL.
I added my both certificates RootCA and intermediate into trusted store in my JAVA_HOME directory.
Check below my source code:
SSLSocketFactory sslSocketFactory = sslcontext.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
HttpsURLConnection httpsConn = (HttpsURLConnection)url.openConnection();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
String xmlInput = "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.gdsp.vodafone.com/">n" +
" <soapenv:Header>n" +
" <ws:gdspHeader>n" +
" <gdspCredentials>n" +
" <password>***</password>n" +
" <userId>zainmdw</userId>n" +
" </gdspCredentials>n" +
" </ws:gdspHeader>n" +
" </soapenv:Header>n" +
" <soapenv:Body>n" +
" <ws:submitReportRequest>n" +
" <reportName>" + reportname + "</reportName>n" +
" <reportFormat>XML</reportFormat>n" +
" <reportParameters>n" +
" <parameter>n" +
" <name>CUSTOMER_CODE</name>n" +
" <value>" + customer_code + "</value>n" +
" </parameter>n" +
" <parameter>n" +
" <name>PERIOD_START</name>n" +
" <value>" + period_start + "</value>n" +
" </parameter>n" +
" </reportParameters>n" +
" <notificationType>N</notificationType>n" +
" <notificationUser>zainmdw</notificationUser>n" +
" <reportPriority>1</reportPriority>n" +
" </ws:submitReportRequest>n" +
" </soapenv:Body>n" +
"</soapenv:Envelope>";
byte buffer = new byte[xmlInput.length()];
buffer = xmlInput.getBytes();
bout.write(buffer);
byte b = bout.toByteArray();
String SOAPAction =
"https://m2mprdapi.vodafone.com:11851/GDSPWebServices/ReportRequestService";
// Set the appropriate HTTP parameters.
httpsConn.setRequestProperty("Content-Length",
String.valueOf(b.length));
httpsConn.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
httpsConn.setRequestProperty("SOAPAction", "submitReportRequest");
httpsConn.setRequestMethod("POST");
httpsConn.setDoOutput(true);
httpsConn.setDoInput(true);
OutputStream out = httpsConn.getOutputStream();
And here is the trace:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
sun.security.ssl.Alerts.getSSLException(Alerts.java:192) StackTraceElement
sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) StackTraceElement
sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) StackTraceElement
sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) StackTraceElement
sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514) StackTraceElement
sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216) StackTraceElement
sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026) StackTraceElement
sun.security.ssl.Handshaker.process_record(Handshaker.java:961) StackTraceElement
sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) StackTraceElement
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) StackTraceElement
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) StackTraceElement
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) StackTraceElement
sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) StackTraceElement
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) StackTraceElement
sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) StackTraceElement
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) StackTraceElement
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) StackTraceElement
sa.zainksa.BusinessLogic.VF_APIs.SendSoapRequest(VF_APIs.java:149) StackTraceElement
sa.zain.mdwSessionEJBClient.main(mdwSessionEJBClient.java:49) StackTraceElement
I did a lot of research to get solution for this exception with no luck to have a solution.
Any one can help me please?
java ssl ssl-certificate x509certificate jdeveloper
I am using JDeveloper 12c trying to connect to secure web service SSL.
I added my both certificates RootCA and intermediate into trusted store in my JAVA_HOME directory.
Check below my source code:
SSLSocketFactory sslSocketFactory = sslcontext.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
HttpsURLConnection httpsConn = (HttpsURLConnection)url.openConnection();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
String xmlInput = "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.gdsp.vodafone.com/">n" +
" <soapenv:Header>n" +
" <ws:gdspHeader>n" +
" <gdspCredentials>n" +
" <password>***</password>n" +
" <userId>zainmdw</userId>n" +
" </gdspCredentials>n" +
" </ws:gdspHeader>n" +
" </soapenv:Header>n" +
" <soapenv:Body>n" +
" <ws:submitReportRequest>n" +
" <reportName>" + reportname + "</reportName>n" +
" <reportFormat>XML</reportFormat>n" +
" <reportParameters>n" +
" <parameter>n" +
" <name>CUSTOMER_CODE</name>n" +
" <value>" + customer_code + "</value>n" +
" </parameter>n" +
" <parameter>n" +
" <name>PERIOD_START</name>n" +
" <value>" + period_start + "</value>n" +
" </parameter>n" +
" </reportParameters>n" +
" <notificationType>N</notificationType>n" +
" <notificationUser>zainmdw</notificationUser>n" +
" <reportPriority>1</reportPriority>n" +
" </ws:submitReportRequest>n" +
" </soapenv:Body>n" +
"</soapenv:Envelope>";
byte buffer = new byte[xmlInput.length()];
buffer = xmlInput.getBytes();
bout.write(buffer);
byte b = bout.toByteArray();
String SOAPAction =
"https://m2mprdapi.vodafone.com:11851/GDSPWebServices/ReportRequestService";
// Set the appropriate HTTP parameters.
httpsConn.setRequestProperty("Content-Length",
String.valueOf(b.length));
httpsConn.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
httpsConn.setRequestProperty("SOAPAction", "submitReportRequest");
httpsConn.setRequestMethod("POST");
httpsConn.setDoOutput(true);
httpsConn.setDoInput(true);
OutputStream out = httpsConn.getOutputStream();
And here is the trace:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
sun.security.ssl.Alerts.getSSLException(Alerts.java:192) StackTraceElement
sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) StackTraceElement
sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) StackTraceElement
sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) StackTraceElement
sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514) StackTraceElement
sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216) StackTraceElement
sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026) StackTraceElement
sun.security.ssl.Handshaker.process_record(Handshaker.java:961) StackTraceElement
sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) StackTraceElement
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) StackTraceElement
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) StackTraceElement
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) StackTraceElement
sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) StackTraceElement
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) StackTraceElement
sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) StackTraceElement
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) StackTraceElement
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) StackTraceElement
sa.zainksa.BusinessLogic.VF_APIs.SendSoapRequest(VF_APIs.java:149) StackTraceElement
sa.zain.mdwSessionEJBClient.main(mdwSessionEJBClient.java:49) StackTraceElement
I did a lot of research to get solution for this exception with no luck to have a solution.
Any one can help me please?
java ssl ssl-certificate x509certificate jdeveloper
java ssl ssl-certificate x509certificate jdeveloper
edited Nov 21 '18 at 10:16
Ahmed Hassan
asked Nov 21 '18 at 9:08


Ahmed HassanAhmed Hassan
164
164
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408549%2fjdeveloper-cert-issue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408549%2fjdeveloper-cert-issue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown