bindings.py 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. """
  2. This module uses ctypes to bind a whole bunch of functions and constants from
  3. SecureTransport. The goal here is to provide the low-level API to
  4. SecureTransport. These are essentially the C-level functions and constants, and
  5. they're pretty gross to work with.
  6. This code is a bastardised version of the code found in Will Bond's oscrypto
  7. library. An enormous debt is owed to him for blazing this trail for us. For
  8. that reason, this code should be considered to be covered both by urllib3's
  9. license and by oscrypto's:
  10. Copyright (c) 2015-2016 Will Bond <will@wbond.net>
  11. Permission is hereby granted, free of charge, to any person obtaining a
  12. copy of this software and associated documentation files (the "Software"),
  13. to deal in the Software without restriction, including without limitation
  14. the rights to use, copy, modify, merge, publish, distribute, sublicense,
  15. and/or sell copies of the Software, and to permit persons to whom the
  16. Software is furnished to do so, subject to the following conditions:
  17. The above copyright notice and this permission notice shall be included in
  18. all copies or substantial portions of the Software.
  19. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  24. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  25. DEALINGS IN THE SOFTWARE.
  26. """
  27. from __future__ import absolute_import
  28. import platform
  29. from ctypes.util import find_library
  30. from ctypes import (
  31. c_void_p,
  32. c_int32,
  33. c_char_p,
  34. c_size_t,
  35. c_byte,
  36. c_uint32,
  37. c_ulong,
  38. c_long,
  39. c_bool,
  40. )
  41. from ctypes import CDLL, POINTER, CFUNCTYPE
  42. from urllib3.packages.six import raise_from
  43. if platform.system() != "Darwin":
  44. raise ImportError("Only macOS is supported")
  45. version = platform.mac_ver()[0]
  46. version_info = tuple(map(int, version.split(".")))
  47. if version_info < (10, 8):
  48. raise OSError(
  49. "Only OS X 10.8 and newer are supported, not %s.%s"
  50. % (version_info[0], version_info[1])
  51. )
  52. def load_cdll(name, macos10_16_path):
  53. """Loads a CDLL by name, falling back to known path on 10.16+"""
  54. try:
  55. # Big Sur is technically 11 but we use 10.16 due to the Big Sur
  56. # beta being labeled as 10.16.
  57. if version_info >= (10, 16):
  58. path = macos10_16_path
  59. else:
  60. path = find_library(name)
  61. if not path:
  62. raise OSError # Caught and reraised as 'ImportError'
  63. return CDLL(path, use_errno=True)
  64. except OSError:
  65. raise_from(ImportError("The library %s failed to load" % name), None)
  66. Security = load_cdll(
  67. "Security", "/System/Library/Frameworks/Security.framework/Security"
  68. )
  69. CoreFoundation = load_cdll(
  70. "CoreFoundation",
  71. "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation",
  72. )
  73. Boolean = c_bool
  74. CFIndex = c_long
  75. CFStringEncoding = c_uint32
  76. CFData = c_void_p
  77. CFString = c_void_p
  78. CFArray = c_void_p
  79. CFMutableArray = c_void_p
  80. CFDictionary = c_void_p
  81. CFError = c_void_p
  82. CFType = c_void_p
  83. CFTypeID = c_ulong
  84. CFTypeRef = POINTER(CFType)
  85. CFAllocatorRef = c_void_p
  86. OSStatus = c_int32
  87. CFDataRef = POINTER(CFData)
  88. CFStringRef = POINTER(CFString)
  89. CFArrayRef = POINTER(CFArray)
  90. CFMutableArrayRef = POINTER(CFMutableArray)
  91. CFDictionaryRef = POINTER(CFDictionary)
  92. CFArrayCallBacks = c_void_p
  93. CFDictionaryKeyCallBacks = c_void_p
  94. CFDictionaryValueCallBacks = c_void_p
  95. SecCertificateRef = POINTER(c_void_p)
  96. SecExternalFormat = c_uint32
  97. SecExternalItemType = c_uint32
  98. SecIdentityRef = POINTER(c_void_p)
  99. SecItemImportExportFlags = c_uint32
  100. SecItemImportExportKeyParameters = c_void_p
  101. SecKeychainRef = POINTER(c_void_p)
  102. SSLProtocol = c_uint32
  103. SSLCipherSuite = c_uint32
  104. SSLContextRef = POINTER(c_void_p)
  105. SecTrustRef = POINTER(c_void_p)
  106. SSLConnectionRef = c_uint32
  107. SecTrustResultType = c_uint32
  108. SecTrustOptionFlags = c_uint32
  109. SSLProtocolSide = c_uint32
  110. SSLConnectionType = c_uint32
  111. SSLSessionOption = c_uint32
  112. try:
  113. Security.SecItemImport.argtypes = [
  114. CFDataRef,
  115. CFStringRef,
  116. POINTER(SecExternalFormat),
  117. POINTER(SecExternalItemType),
  118. SecItemImportExportFlags,
  119. POINTER(SecItemImportExportKeyParameters),
  120. SecKeychainRef,
  121. POINTER(CFArrayRef),
  122. ]
  123. Security.SecItemImport.restype = OSStatus
  124. Security.SecCertificateGetTypeID.argtypes = []
  125. Security.SecCertificateGetTypeID.restype = CFTypeID
  126. Security.SecIdentityGetTypeID.argtypes = []
  127. Security.SecIdentityGetTypeID.restype = CFTypeID
  128. Security.SecKeyGetTypeID.argtypes = []
  129. Security.SecKeyGetTypeID.restype = CFTypeID
  130. Security.SecCertificateCreateWithData.argtypes = [CFAllocatorRef, CFDataRef]
  131. Security.SecCertificateCreateWithData.restype = SecCertificateRef
  132. Security.SecCertificateCopyData.argtypes = [SecCertificateRef]
  133. Security.SecCertificateCopyData.restype = CFDataRef
  134. Security.SecCopyErrorMessageString.argtypes = [OSStatus, c_void_p]
  135. Security.SecCopyErrorMessageString.restype = CFStringRef
  136. Security.SecIdentityCreateWithCertificate.argtypes = [
  137. CFTypeRef,
  138. SecCertificateRef,
  139. POINTER(SecIdentityRef),
  140. ]
  141. Security.SecIdentityCreateWithCertificate.restype = OSStatus
  142. Security.SecKeychainCreate.argtypes = [
  143. c_char_p,
  144. c_uint32,
  145. c_void_p,
  146. Boolean,
  147. c_void_p,
  148. POINTER(SecKeychainRef),
  149. ]
  150. Security.SecKeychainCreate.restype = OSStatus
  151. Security.SecKeychainDelete.argtypes = [SecKeychainRef]
  152. Security.SecKeychainDelete.restype = OSStatus
  153. Security.SecPKCS12Import.argtypes = [
  154. CFDataRef,
  155. CFDictionaryRef,
  156. POINTER(CFArrayRef),
  157. ]
  158. Security.SecPKCS12Import.restype = OSStatus
  159. SSLReadFunc = CFUNCTYPE(OSStatus, SSLConnectionRef, c_void_p, POINTER(c_size_t))
  160. SSLWriteFunc = CFUNCTYPE(
  161. OSStatus, SSLConnectionRef, POINTER(c_byte), POINTER(c_size_t)
  162. )
  163. Security.SSLSetIOFuncs.argtypes = [SSLContextRef, SSLReadFunc, SSLWriteFunc]
  164. Security.SSLSetIOFuncs.restype = OSStatus
  165. Security.SSLSetPeerID.argtypes = [SSLContextRef, c_char_p, c_size_t]
  166. Security.SSLSetPeerID.restype = OSStatus
  167. Security.SSLSetCertificate.argtypes = [SSLContextRef, CFArrayRef]
  168. Security.SSLSetCertificate.restype = OSStatus
  169. Security.SSLSetCertificateAuthorities.argtypes = [SSLContextRef, CFTypeRef, Boolean]
  170. Security.SSLSetCertificateAuthorities.restype = OSStatus
  171. Security.SSLSetConnection.argtypes = [SSLContextRef, SSLConnectionRef]
  172. Security.SSLSetConnection.restype = OSStatus
  173. Security.SSLSetPeerDomainName.argtypes = [SSLContextRef, c_char_p, c_size_t]
  174. Security.SSLSetPeerDomainName.restype = OSStatus
  175. Security.SSLHandshake.argtypes = [SSLContextRef]
  176. Security.SSLHandshake.restype = OSStatus
  177. Security.SSLRead.argtypes = [SSLContextRef, c_char_p, c_size_t, POINTER(c_size_t)]
  178. Security.SSLRead.restype = OSStatus
  179. Security.SSLWrite.argtypes = [SSLContextRef, c_char_p, c_size_t, POINTER(c_size_t)]
  180. Security.SSLWrite.restype = OSStatus
  181. Security.SSLClose.argtypes = [SSLContextRef]
  182. Security.SSLClose.restype = OSStatus
  183. Security.SSLGetNumberSupportedCiphers.argtypes = [SSLContextRef, POINTER(c_size_t)]
  184. Security.SSLGetNumberSupportedCiphers.restype = OSStatus
  185. Security.SSLGetSupportedCiphers.argtypes = [
  186. SSLContextRef,
  187. POINTER(SSLCipherSuite),
  188. POINTER(c_size_t),
  189. ]
  190. Security.SSLGetSupportedCiphers.restype = OSStatus
  191. Security.SSLSetEnabledCiphers.argtypes = [
  192. SSLContextRef,
  193. POINTER(SSLCipherSuite),
  194. c_size_t,
  195. ]
  196. Security.SSLSetEnabledCiphers.restype = OSStatus
  197. Security.SSLGetNumberEnabledCiphers.argtype = [SSLContextRef, POINTER(c_size_t)]
  198. Security.SSLGetNumberEnabledCiphers.restype = OSStatus
  199. Security.SSLGetEnabledCiphers.argtypes = [
  200. SSLContextRef,
  201. POINTER(SSLCipherSuite),
  202. POINTER(c_size_t),
  203. ]
  204. Security.SSLGetEnabledCiphers.restype = OSStatus
  205. Security.SSLGetNegotiatedCipher.argtypes = [SSLContextRef, POINTER(SSLCipherSuite)]
  206. Security.SSLGetNegotiatedCipher.restype = OSStatus
  207. Security.SSLGetNegotiatedProtocolVersion.argtypes = [
  208. SSLContextRef,
  209. POINTER(SSLProtocol),
  210. ]
  211. Security.SSLGetNegotiatedProtocolVersion.restype = OSStatus
  212. Security.SSLCopyPeerTrust.argtypes = [SSLContextRef, POINTER(SecTrustRef)]
  213. Security.SSLCopyPeerTrust.restype = OSStatus
  214. Security.SecTrustSetAnchorCertificates.argtypes = [SecTrustRef, CFArrayRef]
  215. Security.SecTrustSetAnchorCertificates.restype = OSStatus
  216. Security.SecTrustSetAnchorCertificatesOnly.argstypes = [SecTrustRef, Boolean]
  217. Security.SecTrustSetAnchorCertificatesOnly.restype = OSStatus
  218. Security.SecTrustEvaluate.argtypes = [SecTrustRef, POINTER(SecTrustResultType)]
  219. Security.SecTrustEvaluate.restype = OSStatus
  220. Security.SecTrustGetCertificateCount.argtypes = [SecTrustRef]
  221. Security.SecTrustGetCertificateCount.restype = CFIndex
  222. Security.SecTrustGetCertificateAtIndex.argtypes = [SecTrustRef, CFIndex]
  223. Security.SecTrustGetCertificateAtIndex.restype = SecCertificateRef
  224. Security.SSLCreateContext.argtypes = [
  225. CFAllocatorRef,
  226. SSLProtocolSide,
  227. SSLConnectionType,
  228. ]
  229. Security.SSLCreateContext.restype = SSLContextRef
  230. Security.SSLSetSessionOption.argtypes = [SSLContextRef, SSLSessionOption, Boolean]
  231. Security.SSLSetSessionOption.restype = OSStatus
  232. Security.SSLSetProtocolVersionMin.argtypes = [SSLContextRef, SSLProtocol]
  233. Security.SSLSetProtocolVersionMin.restype = OSStatus
  234. Security.SSLSetProtocolVersionMax.argtypes = [SSLContextRef, SSLProtocol]
  235. Security.SSLSetProtocolVersionMax.restype = OSStatus
  236. Security.SecCopyErrorMessageString.argtypes = [OSStatus, c_void_p]
  237. Security.SecCopyErrorMessageString.restype = CFStringRef
  238. Security.SSLReadFunc = SSLReadFunc
  239. Security.SSLWriteFunc = SSLWriteFunc
  240. Security.SSLContextRef = SSLContextRef
  241. Security.SSLProtocol = SSLProtocol
  242. Security.SSLCipherSuite = SSLCipherSuite
  243. Security.SecIdentityRef = SecIdentityRef
  244. Security.SecKeychainRef = SecKeychainRef
  245. Security.SecTrustRef = SecTrustRef
  246. Security.SecTrustResultType = SecTrustResultType
  247. Security.SecExternalFormat = SecExternalFormat
  248. Security.OSStatus = OSStatus
  249. Security.kSecImportExportPassphrase = CFStringRef.in_dll(
  250. Security, "kSecImportExportPassphrase"
  251. )
  252. Security.kSecImportItemIdentity = CFStringRef.in_dll(
  253. Security, "kSecImportItemIdentity"
  254. )
  255. # CoreFoundation time!
  256. CoreFoundation.CFRetain.argtypes = [CFTypeRef]
  257. CoreFoundation.CFRetain.restype = CFTypeRef
  258. CoreFoundation.CFRelease.argtypes = [CFTypeRef]
  259. CoreFoundation.CFRelease.restype = None
  260. CoreFoundation.CFGetTypeID.argtypes = [CFTypeRef]
  261. CoreFoundation.CFGetTypeID.restype = CFTypeID
  262. CoreFoundation.CFStringCreateWithCString.argtypes = [
  263. CFAllocatorRef,
  264. c_char_p,
  265. CFStringEncoding,
  266. ]
  267. CoreFoundation.CFStringCreateWithCString.restype = CFStringRef
  268. CoreFoundation.CFStringGetCStringPtr.argtypes = [CFStringRef, CFStringEncoding]
  269. CoreFoundation.CFStringGetCStringPtr.restype = c_char_p
  270. CoreFoundation.CFStringGetCString.argtypes = [
  271. CFStringRef,
  272. c_char_p,
  273. CFIndex,
  274. CFStringEncoding,
  275. ]
  276. CoreFoundation.CFStringGetCString.restype = c_bool
  277. CoreFoundation.CFDataCreate.argtypes = [CFAllocatorRef, c_char_p, CFIndex]
  278. CoreFoundation.CFDataCreate.restype = CFDataRef
  279. CoreFoundation.CFDataGetLength.argtypes = [CFDataRef]
  280. CoreFoundation.CFDataGetLength.restype = CFIndex
  281. CoreFoundation.CFDataGetBytePtr.argtypes = [CFDataRef]
  282. CoreFoundation.CFDataGetBytePtr.restype = c_void_p
  283. CoreFoundation.CFDictionaryCreate.argtypes = [
  284. CFAllocatorRef,
  285. POINTER(CFTypeRef),
  286. POINTER(CFTypeRef),
  287. CFIndex,
  288. CFDictionaryKeyCallBacks,
  289. CFDictionaryValueCallBacks,
  290. ]
  291. CoreFoundation.CFDictionaryCreate.restype = CFDictionaryRef
  292. CoreFoundation.CFDictionaryGetValue.argtypes = [CFDictionaryRef, CFTypeRef]
  293. CoreFoundation.CFDictionaryGetValue.restype = CFTypeRef
  294. CoreFoundation.CFArrayCreate.argtypes = [
  295. CFAllocatorRef,
  296. POINTER(CFTypeRef),
  297. CFIndex,
  298. CFArrayCallBacks,
  299. ]
  300. CoreFoundation.CFArrayCreate.restype = CFArrayRef
  301. CoreFoundation.CFArrayCreateMutable.argtypes = [
  302. CFAllocatorRef,
  303. CFIndex,
  304. CFArrayCallBacks,
  305. ]
  306. CoreFoundation.CFArrayCreateMutable.restype = CFMutableArrayRef
  307. CoreFoundation.CFArrayAppendValue.argtypes = [CFMutableArrayRef, c_void_p]
  308. CoreFoundation.CFArrayAppendValue.restype = None
  309. CoreFoundation.CFArrayGetCount.argtypes = [CFArrayRef]
  310. CoreFoundation.CFArrayGetCount.restype = CFIndex
  311. CoreFoundation.CFArrayGetValueAtIndex.argtypes = [CFArrayRef, CFIndex]
  312. CoreFoundation.CFArrayGetValueAtIndex.restype = c_void_p
  313. CoreFoundation.kCFAllocatorDefault = CFAllocatorRef.in_dll(
  314. CoreFoundation, "kCFAllocatorDefault"
  315. )
  316. CoreFoundation.kCFTypeArrayCallBacks = c_void_p.in_dll(
  317. CoreFoundation, "kCFTypeArrayCallBacks"
  318. )
  319. CoreFoundation.kCFTypeDictionaryKeyCallBacks = c_void_p.in_dll(
  320. CoreFoundation, "kCFTypeDictionaryKeyCallBacks"
  321. )
  322. CoreFoundation.kCFTypeDictionaryValueCallBacks = c_void_p.in_dll(
  323. CoreFoundation, "kCFTypeDictionaryValueCallBacks"
  324. )
  325. CoreFoundation.CFTypeRef = CFTypeRef
  326. CoreFoundation.CFArrayRef = CFArrayRef
  327. CoreFoundation.CFStringRef = CFStringRef
  328. CoreFoundation.CFDictionaryRef = CFDictionaryRef
  329. except (AttributeError):
  330. raise ImportError("Error initializing ctypes")
  331. class CFConst(object):
  332. """
  333. A class object that acts as essentially a namespace for CoreFoundation
  334. constants.
  335. """
  336. kCFStringEncodingUTF8 = CFStringEncoding(0x08000100)
  337. class SecurityConst(object):
  338. """
  339. A class object that acts as essentially a namespace for Security constants.
  340. """
  341. kSSLSessionOptionBreakOnServerAuth = 0
  342. kSSLProtocol2 = 1
  343. kSSLProtocol3 = 2
  344. kTLSProtocol1 = 4
  345. kTLSProtocol11 = 7
  346. kTLSProtocol12 = 8
  347. # SecureTransport does not support TLS 1.3 even if there's a constant for it
  348. kTLSProtocol13 = 10
  349. kTLSProtocolMaxSupported = 999
  350. kSSLClientSide = 1
  351. kSSLStreamType = 0
  352. kSecFormatPEMSequence = 10
  353. kSecTrustResultInvalid = 0
  354. kSecTrustResultProceed = 1
  355. # This gap is present on purpose: this was kSecTrustResultConfirm, which
  356. # is deprecated.
  357. kSecTrustResultDeny = 3
  358. kSecTrustResultUnspecified = 4
  359. kSecTrustResultRecoverableTrustFailure = 5
  360. kSecTrustResultFatalTrustFailure = 6
  361. kSecTrustResultOtherError = 7
  362. errSSLProtocol = -9800
  363. errSSLWouldBlock = -9803
  364. errSSLClosedGraceful = -9805
  365. errSSLClosedNoNotify = -9816
  366. errSSLClosedAbort = -9806
  367. errSSLXCertChainInvalid = -9807
  368. errSSLCrypto = -9809
  369. errSSLInternal = -9810
  370. errSSLCertExpired = -9814
  371. errSSLCertNotYetValid = -9815
  372. errSSLUnknownRootCert = -9812
  373. errSSLNoRootCert = -9813
  374. errSSLHostNameMismatch = -9843
  375. errSSLPeerHandshakeFail = -9824
  376. errSSLPeerUserCancelled = -9839
  377. errSSLWeakPeerEphemeralDHKey = -9850
  378. errSSLServerAuthCompleted = -9841
  379. errSSLRecordOverflow = -9847
  380. errSecVerifyFailed = -67808
  381. errSecNoTrustSettings = -25263
  382. errSecItemNotFound = -25300
  383. errSecInvalidTrustSettings = -25262
  384. # Cipher suites. We only pick the ones our default cipher string allows.
  385. # Source: https://developer.apple.com/documentation/security/1550981-ssl_cipher_suite_values
  386. TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C
  387. TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030
  388. TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B
  389. TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F
  390. TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA9
  391. TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA8
  392. TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F
  393. TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E
  394. TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024
  395. TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028
  396. TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A
  397. TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014
  398. TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B
  399. TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039
  400. TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023
  401. TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027
  402. TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009
  403. TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013
  404. TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067
  405. TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033
  406. TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D
  407. TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C
  408. TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D
  409. TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C
  410. TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035
  411. TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F
  412. TLS_AES_128_GCM_SHA256 = 0x1301
  413. TLS_AES_256_GCM_SHA384 = 0x1302
  414. TLS_AES_128_CCM_8_SHA256 = 0x1305
  415. TLS_AES_128_CCM_SHA256 = 0x1304