Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Security SSL HttpsUrlConnection
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Luciano Santos
SSL HttpsUrlConnection
2 Answer(s)      4 years and a month ago
Posted in : Security


Hi,

My name is Luciano, I am trying to implement a ssl comunication between a desktop application and a web application. I unable the https on JBoss and I have two files ca.crt and server.crt, I install the server crt on the browser and test the connection, all occour perfectly, But when I try connect using my desktop aplication i get the error:

Exception in thread "main" 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
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1611)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1035)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:124)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)

I search the solution, but the most of response dont solve my problem, what can I do to solve this problem? The connection code is:

    URL page = new URL(url);
    HttpsURLConnection connection = (HttpsURLConnection) page
            .openConnection();

    File trustFile = new File("C:/myteste/truststore");
    File keyFile = new File("C:/myteste/keystore");

    connection.setDefaultSSLSocketFactory(this.getSSLSocketFactory(
            trustFile, "teste", keyFile, "teste"));

Advertisement
View Answers

March 11, 2011 at 3:00 PM


Hi Lusiano,

I am trying to implement a ssl comunication between a desktop application and a web application. can you please share code with me.

Please explain me 'connection.setDefaultSSLSocketFactory(this.getSSLSocketFactory( trustFile, "teste", keyFile, "teste"));' code. what is 'teste'?

Please help me.

thanks and regards

sivjava



March 11, 2011 at 6:14 PM


Teste = Test, I am Brazilian

You don�´t need have a trustManager or KeyManager in code. You can install the certificate in the S.O and initialize the SSLContext with this code: context.init(null, null, null);

The SSLContext will be use the installed certificate.



Related Tutorials/Questions & Answers:
SSL HttpsUrlConnection
SSL HttpsUrlConnection  Hi, My name is Luciano, I am trying to implement a ssl comunication between a desktop application and a web application. I... is: URL page = new URL(url); HttpsURLConnection connection
ssl client - JSP-Servlet
ssl client  How do you write SSL Client? Take example of SSL Socket Client
Advertisements
SSL Authentication - JSP-Servlet
SSL Authentication  With the help of a sample code describe the use of SSL Authentication of java clients
SSL for login page
SSL for login page  I am trying to apply ssl cert to login page only. Does anyone know how to do this on a tomcat web server
SSL Certificates
SSL Certificates Secure Sockets Layer or SSL for short is a protocol. It was developed by Netscape for transmitting private documents over internet. SSL.... URLs requiring the SSL connection starts with https: instead of http
Steps For SSL Implementation/Enabling in Apache Tomcat 6.0
Steps For SSL Implementation/Enabling in Apache Tomcat 6.0   Hi , I am using the NetBeans 6.9 IDE Apache Tomcat 6.0 as Web server Front end jsp-servlet please gives me complete guidance steps ,code for SSL Implementation
Steps For SSL Implementation/Enabling in Apache Tomcat 6.0
Steps For SSL Implementation/Enabling in Apache Tomcat 6.0   Hi , I am using the NetBeans 6.9 IDE Apache Tomcat 6.0 as Web server Front end jsp-servlet please gives me complete guidance steps ,code for SSL Implementation
ssl comunication between a desktop application and a web application
ssl comunication between a desktop application and a web application  Hi Lusiano, I am trying to implement a ssl comunication between a desktop application and a web application. can you please share code with me. Please
Problem in Blazeds with Jboss Clustering ( Mod_JK with SSL )
Problem in Blazeds with Jboss Clustering ( Mod_JK with SSL )  Hi... of Apache mod_jk(Apache Web server as front end with mod_ssl enabled). We are using the SecureAMFChannel as we deploy the application in SSL. We use
how to copy files from remote to local machine using SFTP SSL in java?
how to copy files from remote to local machine using SFTP SSL in java?  I want to copy files from remote server to local machine using SFTP and SSL in java. Plz help
E-Commerce Web Hosting
. These tools are shopping carts, Merchant Account services, SSL (Secure Socket... should support SSL secure servers (128 bit) encryption   ... Should not be expensive Public and private SSL
structs - Struts
struts ssl login  How to create struts ssl login
session tracking
session tracking  What are the common mechanisms used for session tracking?    Cookies SSL sessions URL- rewriting
LDAP Authentication
LDAP Authentication  Dear Friends how to ignore the Ldap Signing over Ldap Connection 389.can anyone help me. Note: SSL should not be enabled
javamail
javamail  i need java mail code,i had use some code,that give me ssl error in java,plz help me,i need urgent basises
Apache server - Security
Apache server  I am confiure apache webser based httpd.cong file security reason. i am tring to configure port 443 of ssl in apache server.after configuring the apache started well. but nothing to display. it displayed some error
FileZilla
, SFTP, and FTPS (FTP over SSL/TLS). As of August 10, 2007, it was the 12th most... project and features support for FTP and FTP over SSL/TLS. Click here to download
Call Https Url
Call Https Url  I have written web service and hosted project on server with SSL certificate.If I want to call HTTPS url, I need to import certificate in JVM manually or through program on client side. I can't ask any client
403 Forbidden error - What is 403 Forbidden error, please explain...
forbidden. * 403.3 - Write access forbidden. * 403.4 - SSL required. * 403.5 - SSL 128 required. * 403.6 - IP address rejected. * 403.7.... * 403.3 - Write access forbidden. * 403.4 - SSL required. * 403.5
What is WTLS?
), formerly known as Secure Sockets Layer (SSL
https suport - JSP-Servlet
with the tomcat server. Please http://tomcat.apache.org/tomcat-4.0-doc/ssl
Why do I need Dedicated IP?
of this are that they include a private SSL certificate and an anonymous FTP. An SSL
After authentication and connection establishment, Upload a zipfile by chunks in java
) { URL obj = new URL(url); conn = (HttpsURLConnection...;q=0.9,*/*;q=0.8"); conn.setRequestProperty("Accept-Encoding...("Accept-Language", "en-US,en;q=0.5"); String cookieString
After authentication and connection establishmenr, Upload a zipfile by chunks in java
) { URL obj = new URL(url); conn = (HttpsURLConnection...("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); conn.setRequestProperty("Accept-Encoding
After authentication and connection establishmenr, Upload a zipfile by chunks in java
) { URL obj = new URL(url); conn = (HttpsURLConnection...("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); conn.setRequestProperty("Accept-Encoding
Self Signed Certificate
as a ssl server. For testing i prefer self signed certificate. But i have
Self Signed Certificate
as a ssl server. For testing i prefer self signed certificate. But i have
servlets
authentication is based on HTTP over SSL. It requires that the end clientshould possess
iPhone Security and Safety Tips
using your iPhone for sending or receiving emails remember to do so over a SSL protocol. The Secure Sockets Layer (SSL) encrypts all mail sent and received via your iPhone. Using a non-SSL mail client can seriously compromise your privacy
Manage end-user state and understand performance tradeoffs of using HTTP sessions
or Secure Sockets Layer (SSL), another alternative is to use SSL information... tracking with SSL information... (SSL) information. To use SSL
 

 

 

DMCA.com