5 // Created by Martin Baulig on 14/11/15.
6 // Copyright (c) 2015 Xamarin. All rights reserved.
9 #ifndef __btls__btls_ssl__
10 #define __btls__btls_ssl__
12 #include <btls-ssl-ctx.h>
15 mono_btls_ssl_new (MonoBtlsSslCtx
*ctx
);
18 mono_btls_ssl_use_certificate (MonoBtlsSsl
*ptr
, X509
*x509
);
21 mono_btls_ssl_use_private_key (MonoBtlsSsl
*ptr
, EVP_PKEY
*key
);
24 mono_btls_ssl_add_chain_certificate (MonoBtlsSsl
*ptr
, X509
*x509
);
27 mono_btls_ssl_accept (MonoBtlsSsl
*ptr
);
30 mono_btls_ssl_connect (MonoBtlsSsl
*ptr
);
33 mono_btls_ssl_handshake (MonoBtlsSsl
*ptr
);
36 mono_btls_ssl_print_errors_cb (ERR_print_errors_callback_t callback
, void *ctx
);
39 mono_btls_ssl_set_bio (MonoBtlsSsl
*ptr
, BIO
*bio
);
42 mono_btls_ssl_read (MonoBtlsSsl
*ptr
, void *buf
, int count
);
45 mono_btls_ssl_write (MonoBtlsSsl
*ptr
, void *buf
, int count
);
48 mono_btls_ssl_get_version (MonoBtlsSsl
*ptr
);
51 mono_btls_ssl_set_min_version (MonoBtlsSsl
*ptr
, int version
);
54 mono_btls_ssl_set_max_version (MonoBtlsSsl
*ptr
, int version
);
57 mono_btls_ssl_get_cipher (MonoBtlsSsl
*ptr
);
60 mono_btls_ssl_set_cipher_list (MonoBtlsSsl
*ptr
, const char *str
);
63 mono_btls_ssl_get_ciphers (MonoBtlsSsl
*ptr
, uint16_t **data
);
66 mono_btls_ssl_get_peer_certificate (MonoBtlsSsl
*ptr
);
69 mono_btls_ssl_close (MonoBtlsSsl
*ptr
);
72 mono_btls_ssl_shutdown (MonoBtlsSsl
*ptr
);
75 mono_btls_ssl_set_quiet_shutdown (MonoBtlsSsl
*ptr
, int mode
);
78 mono_btls_ssl_get_error (MonoBtlsSsl
*ptr
, int ret_code
);
81 mono_btls_ssl_set_verify_param (MonoBtlsSsl
*ptr
, const MonoBtlsX509VerifyParam
*param
);
84 mono_btls_ssl_set_server_name (MonoBtlsSsl
*ptr
, const char *name
);
87 mono_btls_ssl_get_server_name (MonoBtlsSsl
*ptr
);
90 MONO_BTLS_SSL_RENEGOTIATE_NEVER
= 0,
91 MONO_BTLS_SSL_RENEGOTIATE_ONCE
,
92 MONO_BTLS_SSL_RENEGOTIATE_FREELY
,
93 MONO_BTLS_SSL_RENEGOTIATE_IGNORE
94 } MonoBtlsSslRenegotiateMode
;
97 mono_btls_ssl_set_renegotiate_mode (MonoBtlsSsl
*ptr
, MonoBtlsSslRenegotiateMode mode
);
100 mono_btls_ssl_renegotiate_pending (MonoBtlsSsl
*ptr
);
103 mono_btls_ssl_destroy (MonoBtlsSsl
*ptr
);
105 #endif /* defined(__btls__btls_ssl__) */