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



Home Answers Viewqa Security SSL HttpsUrlConnection

Have Programming Question? Ask it here!
 
 
 


Luciano Santos
SSL HttpsUrlConnection
2 Answer(s)      3 years and 7 months 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
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
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
Why do I need Dedicated IP?
of this are that they include a private SSL certificate and an anonymous FTP. An SSL
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
Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1 - JavaMail
=System.getProperties(); String SSL_FACTORY...("mail.smtp.socketFactory.class",SSL_FACTORY); prps.put
Xcarecrows4 Web Services
Tomcat and Apache Axis2. SSL ready ! Start, stop and restart Apache Tomcat... efficiently. Install, start, stop and restart Apache Tomcat, set Apache SSL, manage users
What Security Functions Do You Need for Ecommerce?
that allege to offer close to those numbers. SSL Encryption Need for Secure Ecommerce Sites SSL stands for severe sockets layer. This gives the site protection over..., 128 or 256 bit SSL bit encryption shared, protection monitoring in real-time
Cookies in JSP
the browser and server under the SSL or non- SSL connection. 2) Secure authentication cookie: It is used to authenticate the data. This cookie flow over SSL
Ecommerce web hosting
and MySQL support b) Merchant account services support c) SSL Support d
aSSL Secure Connection
aSSL Secure Connection       aSSL ( Ajax Secure Service Layer ) is a libraries implements the technology similar to the SSL distributed under MIT license.   The aSSL
Implementing WS-Security
a combination of HTTPS/SSL, digital certificates, and digital signature
Security Measure of Website
Layer Encryption (SSL) Certificates is one of them in which certificates
Unix Web Hosting
both you and the customer when an order is completed.  Secure Server (SSL... important for some business. So, its very import to have the SSL support for the web
Hosted E-Commerce Solution
; Server security Your server should be secure and provide the valid SSL... SSL certificate. The Hosted E-Commerce Solution provider should provide
Most Common TCP Ports
protocol 194 x irc internet relay chat 213 x ipx 389 x ldap 443 x x https (ssl... rmonitor 561 x monitor 636 x ldaps over tls/ssl 666 x x doom id software 749
Error using SoapClient() in PHP
parameter and active SSL on my server, still I'm getting an error. Here is the code I'm
weblogic server
management tasks more efficient and features such as Secure Sockets Layer (SSL
J2EE Interviews Question page7,J2EE Interviews Guide,J2EE Interviews
.    What is HTTPS ? HTTP layered over the SSL protocol
Vuzit
distributing content without your consent; SSL (Secure Socket Layers) with 256
Web hosting with shopping cart
They monitor your server round the clock They will give SSL support
Front Page Web Hosting
FrontPage Extensions, PHP, MySQL databases, Free SSL, SSI on our Front Page Enabled
StartCom Enterprise Linux 3.0.5 is available now
for the StartCom Free SSL Certification Authority, but also some 300 other updated packages
Web Hosting Glossary
when an order is completed.  Secure Server (SSL):  Securing.... So, its very import to have the SSL support for the web sites.  SSH
E-commerce Hosting Solution
a server. Your web hosting company should provide SSL support, advanced firewall
 

 

 

DMCA.com