/ tls_client / tls_client.h
tls_client.h
1 // 2 // tls_client.h 3 // coretls_client 4 // 5 6 #ifndef __TLS_CLIENT_H__ 7 #define __TLS_CLIENT_H__ 8 9 #include <tls_handshake.h> 10 #include <tls_record.h> 11 #include <tls_stream_parser.h> 12 13 #include <CoreFoundation/CoreFoundation.h> 14 #include <Security/SecTrust.h> 15 16 typedef struct { 17 const char *hostname; 18 const char *service; // service string or port number 19 const char *config; 20 bool dtls; 21 int protocol_min; 22 int protocol_max; 23 const uint16_t *ciphersuites; 24 int num_ciphersuites; 25 bool allow_resumption; 26 bool session_tickets_enabled; 27 bool ocsp_enabled; 28 uintptr_t peer_id; 29 SSLCertificate certs; 30 tls_private_key_t key; 31 const char *alpn_string; 32 const char *request; 33 unsigned min_dh_size; 34 bool fallback; 35 bool allow_ext_master_secret; 36 } tls_client_params; 37 38 39 typedef struct { 40 int sock; 41 dispatch_queue_t write_queue; 42 tls_record_t rec; 43 tls_handshake_t hdsk; 44 tls_stream_parser_t parser; 45 tls_client_params *params; 46 47 int err; 48 int read_ready_received; 49 int write_ready_received; 50 int certificate_requested; 51 52 SecTrustRef trustRef; 53 54 } tls_client_ctx_t; 55 56 57 #endif /* __TLS_CLIENT_H__ */