:I rewrote our app to use the new Network framework for TLS communication. We need to support both iOS 13 and iOS 12.4. I am using the function:
sec_protocol_metadata_get_negotiated_tls_ciphersuite(sec_protocol_metadata_t metadata);
to report what type of TLS connection was formed. This function is documented both in the header files and in the online Apple documentation to be available in iOS 12.0+. And yet with the latest XCode (11.3.1) the simulator runtimes for iOS 12 (all of them: 12.0, 12.1, 12.2, and 12.4) do not have this symbol in the runtime library. I get this error reported in the XCode console when my program attempts to use that API:
dyld: lazy symbol binding failed: Symbol not found: _sec_protocol_metadata_get_negotiated_tls_ciphersuite
Referenced from: /Users/derek/Library/Developer/CoreSimulator/Devices/42B90B8A-BF22-40FE-970B-C78E1DD27B6A/data/Containers/Bundle/Application/A22AF4B2-9AD8-4325-B8D5-D8086A0DF7BD/touch.app/touch
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security
dyld: Symbol not found: _sec_protocol_metadata_get_negotiated_tls_ciphersuite
Referenced from: /Users/derek/Library/Developer/CoreSimulator/Devices/42B90B8A-BF22-40FE-970B-C78E1DD27B6A/data/Containers/Bundle/Application/A22AF4B2-9AD8-4325-B8D5-D8086A0DF7BD/touch.app/touch
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security
I also searched the symbol names in the simulator dynamic library for the Security framework and did indeed discover that they appear to be missing both of the tls metadata functions. Here are the symbols in the iOS 12.4 Security dynamic library starting with "sec_protocol_metadata_get_negot":
nm '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security' | grep sec_protocol_metadata_get_negot
000000000003079f t ___sec_protocol_metadata_get_negotiated_ciphersuite_block_invoke
00000000000303ae t ___sec_protocol_metadata_get_negotiated_protocol_block_invoke
00000000000306f0 t ___sec_protocol_metadata_get_negotiated_protocol_version_block_invoke
000000000003070f T _sec_protocol_metadata_get_negotiated_ciphersuite
0000000000030325 T _sec_protocol_metadata_get_negotiated_protocol
0000000000030663 T _sec_protocol_metadata_get_negotiated_protocol_version
Here is the same list for the iOS 13.2 Security dynamic library:
nm /Applications/Xcode.app//Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security | grep sec_protocol_metadata_get_negot
0000000000021d68 t ___sec_protocol_metadata_get_negotiated_protocol_block_invoke
00000000000225d3 t ___sec_protocol_metadata_get_negotiated_protocol_version_block_invoke
0000000000022682 t ___sec_protocol_metadata_get_negotiated_tls_ciphersuite_block_invoke
0000000000022506 t ___sec_protocol_metadata_get_negotiated_tls_protocol_version_block_invoke
00000000000226a3 T _sec_protocol_metadata_get_negotiated_ciphersuite
0000000000021cdf T _sec_protocol_metadata_get_negotiated_protocol
0000000000022546 T _sec_protocol_metadata_get_negotiated_protocol_version
00000000000225f2 T _sec_protocol_metadata_get_negotiated_tls_ciphersuite
0000000000022478 T _sec_protocol_metadata_get_negotiated_tls_protocol_version
Note the two TLS related ones at the end that are in the 13.2 library, but not the 12.4 library.
My app runs fine with the iOS 13 simulated runtime.
Is this a bug in the simulator?
Or is this a documentation bug?
Most importantly is this function supported on a real iPhone with iOS 12.4?