How to Enforce TLS version and Cipher Suites in Client Hello message?

I would like to enforce the TLS version and Cipher suites in the Client Hello message. Now i'm using the URLSession to make the Calls.


I saw the following threads, from that i understood URLSeesion can not enforce cipher suites

https://forums.developer.apple.com/message/194402#194402

https://forums.developer.apple.com/thread/49710

Is it possible to enforce TLS version and cipher suites using SSLContext?? If yes, Can you provide some example to make REST call with enforcing TLS version and cipher suites?

I’m confused by your reasoning here. The standard approach for enforcing a specific TLS version or cypher suite is to enforce that on the server side. You have to do that anyway (because you can’t guarantee that your client will be the only one connecting to your server) and, once you do that, adding enforcement on the client is redundant.

Is there a reason that approach won’t work for you?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

My server supports Multiple TLS versions and cipher suites. I have mulitple client applications which has to communicate using specific TLS version and cipher suite. Lets say for Example,

  • ClientApp1 should communicate using TLS1.1 and TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 cipher suite
  • ClientApp2 should communicate using TLS1.2 and TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 cipher suite


Is there any way to do the same? If yes, can you please share some HelloWorld for calling some REST Api with enforced TLS and cipher suites.

OK, let me answer your direct question first:

  • On the TLS version front, you can configure the minimum and maximum values on a session-by-session basis by setting properties in the

    NSURLSessionConfiguration
    object you use to create the session.
  • On the cypher suite front, your only control is ATS’s forward secrecy requirement. See the discussion of

    NSExceptionRequiresForwardSecrecy
    in the App Transport Security documentation.

As to the overall goal, I’m still quite confused. Are these clients accessing different parts of your server? If so, it seems like you should enforce this on the server side. If not — that is, you have two clients that access the same parts of the server and you want to enforce different TLS options on each — I don’t think that buys you anything security-wise. There’s no way you can stop the attacker pretending to be ClientApp1 and thus getting lower security.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

By Setting the value of

NSExceptionRequiresForwardSecrecy
to
NO
results in the following ciphers which do not support FS and also being accepted: (Following cipher suites are also sent in the Client Hello)
  • TLS_RSA_WITH_AES_256_GCM_SHA384
  • TLS_RSA_WITH_AES_128_GCM_SHA256
  • TLS_RSA_WITH_AES_256_CBC_SHA256
  • TLS_RSA_WITH_AES_256_CBC_SHA
  • TLS_RSA_WITH_AES_128_CBC_SHA256
  • TLS_RSA_WITH_AES_128_CBC_SHA

But here my question is, i want to send only the cipher suites which i desire in the client Hello. Is that possible?

i want to send only the cipher suites which i desire in the client Hello.

I answered that question in my previous post:

On the cypher suite front, your only control is ATS’s forward secrecy requirement.

If that’s your only control, and that control is inadequate for your needs, then there’s no other option.

If you’d like to see

NSURLSession
support more cypher suite configuration options, feel free to file an enhancement request along those lines. If you do that, make sure to include a comprehensive explanation of why this is necessary, because the natural reaction of folks reading your enhancement request is going to be the same as mine, namely, to ask why you’re not implementing these restrictions on the server.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
How to Enforce TLS version and Cipher Suites in Client Hello message?
 
 
Q