Results 1 to 3 of 3
Thread: Read data from custom ca
- 05-11-2011, 09:57 AM #1
Read data from custom ca
Hi everybody.
I have problems with reading data from custom ca.
I had made a configuration my tomcat server like this Life...: How to create Custom CA and Certificates for SSL using Open SSL
and then tried to read data from certificate like this
When I invoke a URL https://localhost:8080/sslaction the server ask me that I have bad ssl certificate.Java Code:import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; import java.security.cert.X509Certificate; public class SSLAction extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/plain"); PrintWriter out = res.getWriter(); X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate"); if (certs != null) { for (int i = 0; i < certs.length; i++) { out.println("Client Certificate [" + i + "] = " + certs[i].toString()); } } else { if ("https".equals(req.getScheme())) { out.println("This was an HTTPS request, but no client certificate is available"); } else { out.println("This was not an HTTPS request, so no client certificate is available"); } } } protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { doGet(req, res); } }
Can anyone help me?Java Code:Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
Skype: petrarsentev
http://TrackStudio.com
- 05-11-2011, 12:14 PM #2
Cross posted
OTN Discussion Forums : Read data from custom ca ...
db
- 05-11-2011, 12:19 PM #3
)) It is nice. You are good moderate, but can you help me?
Skype: petrarsentev
http://TrackStudio.com
Similar Threads
-
Need to Save a data to file from JPanel and read the data back to Jpanel
By yashrajsen in forum AWT / SwingReplies: 1Last Post: 11-09-2010, 09:28 AM -
accessing custom data model values - how?
By dave247 in forum New To JavaReplies: 11Last Post: 03-07-2010, 12:20 PM -
How to read registry data
By anilkumar_vist in forum Advanced JavaReplies: 1Last Post: 11-07-2009, 04:22 PM -
How to read the raw data from TYPE_BYTE_BINARY BufferedImage
By hyz_zsu in forum Java 2DReplies: 1Last Post: 04-06-2009, 05:06 AM -
Unable to read data from inputstream
By renuka_anil in forum Java ServletReplies: 0Last Post: 01-29-2009, 03:20 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks