1

I'm trying to connect to a web server for my application that requires an SSL client certificate for authentication. From the standard documentation, I can't tell how to reuse an SSL session for multiple requests (I don't want to have to a full SSL handshake for every single request as this causes major overhead). Can someone point me in the right direction?

EDIT
I've seen in other posts that HttpClient might be a solution but as of Android 6.0 this has been deprecated in favor of HttpsUrlConnection. Using the following code:

SSLContext sslContext;
HttpsUrlConnection connection = url.openConnection();
connection.setSSLSocketFactory(sslContext.getSocketFactory());

Does a new FULL SSL handshake occur (probably right?) everytime I create a new connection. How do I reuse the session?

user3369427
  • 425
  • 6
  • 14

1 Answers1

0

I can't tell how to reuse an SSL session for multiple requests

It's automatic.

(I don't want to have to a full SSL handshake for every single request as this causes major overhead)

It would cause major overhead, if it ever happened, but it doesn't.

Does a new FULL SSL handshake occur (probably right?) everytime I create a new connection?

No.

How do I reuse the session?

It should happen by default, subject to session timeouts at the server.

user207421
  • 305,947
  • 44
  • 307
  • 483