Android accesses Tomcat SSL two-way authentication server

Source: Internet
Author: User

Project needs to implement two-way SSL verification on Android.

 

Prepare the environment:

Windows 2003 EE;

OpenSSL;

Tomcat 7;

 

Simple process:

1. Use OpenSSL and keytools for Ca, client, and server certificates and private keys.

2. Build a Tomcat web server with two-way authentication.

3. verify the validity of two-way SSL verification with IE.

For the above three steps, see the following document: https SSL two-way authentication under Tomcat

The only problem is that Tomcat 7 has different configurations. Server. xml

 

[XHTML]View
Plaincopy

  1. <Connector
  2. Classname = "org. Apache. Catalina. connector. http. httpconnector"
  3. Protocol = "org. Apache. Coyote. http11.http11nioprotocol"
  4. Port = "8443" minsparethreads = "5" maxsparethreads = "75"
  5. Enablelookups = "true" disableuploadtimeout = "true"
  6. Acceptcount = "100" maxthreads = "200"
  7. Scheme = "HTTPS" secure = "true" sslenabled = "true"
  8. Clientauth = "true" sslprotocol = "TLS"
  9. Keystorefile = "C:/OpenSSL/Server/server_keystore"
  10. Keystorepass = "66666"/>

 

Keystorepass is your server_keystore Password

Change clientauth = "true" to false for one-way authentication.

 

4. Write an SSL verification program for Android, but only one-way authentication of server certificates can be performed. See the link below for the source code.

Android OpenSSL analysis and example-column in zhenyongyuan123

 

5. Write a Java client/server program to verify SSL two-way authentication.

Implement SSL mutual authentication in Java

 

6. To understand the SSL handshake process, test the two-way SSL verification process of Tomcat using OpenSSL command line.

Use OpenSSL to connect to the command line for two-way authentication of Tomcat SSL.

[Python]View
Plaincopy

  1. OpenSSL s_client-connect localhost: 8443-Cert client/client-cert.pem-Key Client/client-key.pem-cafile Ca/ca-cert.pem-state

7. through the above process, we found the problem in Step 4, and solved the problem of Android accessing Tomcat's two-way SSL verification web server.

8. The first step is to directly use Android webview to access Tomcat's two-way SSL server. It is being studied... you may need to modify the source code of webview and study the implementation method of writing the document description separately.

Http://blog.csdn.net/win2k3net/article/details/6165690

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.