@@ -2155,11 +2155,17 @@ _ssl__SSLSocket_compression_impl(PySSLSocket *self)
2155
2155
@critical_section
2156
2156
@getter
2157
2157
_ssl._SSLSocket.context
2158
+
2159
+ This changes the context associated with the SSLSocket.
2160
+
2161
+ This is typically used from within a callback function set by the sni_callback
2162
+ on the SSLContext to change the certificate information associated with the
2163
+ SSLSocket before the cryptographic exchange handshake messages.
2158
2164
[clinic start generated code]*/
2159
2165
2160
2166
static PyObject *
2161
2167
_ssl__SSLSocket_context_get_impl (PySSLSocket * self )
2162
- /*[clinic end generated code: output=d23e82f72f32e3d7 input=25aa82e4d9fa344a ]*/
2168
+ /*[clinic end generated code: output=d23e82f72f32e3d7 input=7cbb97407c2ace30 ]*/
2163
2169
{
2164
2170
return Py_NewRef (self -> ctx );
2165
2171
}
@@ -2226,11 +2232,15 @@ _ssl__SSLSocket_server_hostname_get_impl(PySSLSocket *self)
2226
2232
@critical_section
2227
2233
@getter
2228
2234
_ssl._SSLSocket.owner
2235
+
2236
+ The Python-level owner of this object.
2237
+
2238
+ Passed as "self" in servername callback.
2229
2239
[clinic start generated code]*/
2230
2240
2231
2241
static PyObject *
2232
2242
_ssl__SSLSocket_owner_get_impl (PySSLSocket * self )
2233
- /*[clinic end generated code: output=1f278cb930382927 input=bc2861ff3cf1402e ]*/
2243
+ /*[clinic end generated code: output=1f278cb930382927 input=978a8382d9c25c92 ]*/
2234
2244
{
2235
2245
if (self -> owner == NULL ) {
2236
2246
Py_RETURN_NONE ;
@@ -2844,11 +2854,13 @@ _ssl__SSLSocket_verify_client_post_handshake_impl(PySSLSocket *self)
2844
2854
@critical_section
2845
2855
@getter
2846
2856
_ssl._SSLSocket.session
2857
+
2858
+ The underlying SSLSession object.
2847
2859
[clinic start generated code]*/
2848
2860
2849
2861
static PyObject *
2850
2862
_ssl__SSLSocket_session_get_impl (PySSLSocket * self )
2851
- /*[clinic end generated code: output=a5cd5755b35da670 input=b9792df9255a9f63 ]*/
2863
+ /*[clinic end generated code: output=a5cd5755b35da670 input=d427318604244bf8 ]*/
2852
2864
{
2853
2865
/* get_session can return sessions from a server-side connection,
2854
2866
* it does not check for handshake done or client socket. */
@@ -3650,11 +3662,13 @@ _ssl__SSLContext_maximum_version_set_impl(PySSLContext *self,
3650
3662
@critical_section
3651
3663
@getter
3652
3664
_ssl._SSLContext.num_tickets
3665
+
3666
+ Control the number of TLSv1.3 session tickets.
3653
3667
[clinic start generated code]*/
3654
3668
3655
3669
static PyObject *
3656
3670
_ssl__SSLContext_num_tickets_get_impl (PySSLContext * self )
3657
- /*[clinic end generated code: output=3d06d016318846c9 input=1dee26d75163c073 ]*/
3671
+ /*[clinic end generated code: output=3d06d016318846c9 input=1e2599a2e22564ff ]*/
3658
3672
{
3659
3673
// Clinic seems to be misbehaving when the comment is wrapped with in directive
3660
3674
#if defined(TLS1_3_VERSION ) && !defined(OPENSSL_NO_TLS1_3 )
@@ -3698,11 +3712,13 @@ _ssl__SSLContext_num_tickets_set_impl(PySSLContext *self, PyObject *value)
3698
3712
@critical_section
3699
3713
@getter
3700
3714
_ssl._SSLContext.security_level
3715
+
3716
+ The current security level.
3701
3717
[clinic start generated code]*/
3702
3718
3703
3719
static PyObject *
3704
3720
_ssl__SSLContext_security_level_get_impl (PySSLContext * self )
3705
- /*[clinic end generated code: output=56ece09e6a9572d0 input=a0416598e07c3183 ]*/
3721
+ /*[clinic end generated code: output=56ece09e6a9572d0 input=2bdeecb57bb86e3f ]*/
3706
3722
{
3707
3723
PyObject * res = PyLong_FromLong (SSL_CTX_get_security_level (self -> ctx ));
3708
3724
return res ;
@@ -4659,11 +4675,18 @@ _servername_callback(SSL *s, int *al, void *args)
4659
4675
@critical_section
4660
4676
@getter
4661
4677
_ssl._SSLContext.sni_callback
4678
+
4679
+ Set a callback that will be called when a server name is provided by the SSL/TLS client in the SNI extension.
4680
+
4681
+ If the argument is None then the callback is disabled. The method is called
4682
+ with the SSLSocket, the server name as a string, and the SSLContext object.
4683
+
4684
+ See RFC 6066 for details of the SNI extension.
4662
4685
[clinic start generated code]*/
4663
4686
4664
4687
static PyObject *
4665
4688
_ssl__SSLContext_sni_callback_get_impl (PySSLContext * self )
4666
- /*[clinic end generated code: output=961e6575cdfaf036 input=22dd28c31fdc4318 ]*/
4689
+ /*[clinic end generated code: output=961e6575cdfaf036 input=9b2473c5e984cfe6 ]*/
4667
4690
{
4668
4691
PyObject * cb = self -> set_sni_cb ;
4669
4692
if (cb == NULL ) {
@@ -5236,11 +5259,13 @@ memory_bio_dealloc(PySSLMemoryBIO *self)
5236
5259
@critical_section
5237
5260
@getter
5238
5261
_ssl.MemoryBIO.pending
5262
+
5263
+ The number of bytes pending in the memory BIO.
5239
5264
[clinic start generated code]*/
5240
5265
5241
5266
static PyObject *
5242
5267
_ssl_MemoryBIO_pending_get_impl (PySSLMemoryBIO * self )
5243
- /*[clinic end generated code: output=19236a32a51ac8ff input=c0b6d14eba107f6a ]*/
5268
+ /*[clinic end generated code: output=19236a32a51ac8ff input=02d9063d8ac31732 ]*/
5244
5269
{
5245
5270
size_t res = BIO_ctrl_pending (self -> bio );
5246
5271
return PyLong_FromSize_t (res );
@@ -5250,11 +5275,13 @@ _ssl_MemoryBIO_pending_get_impl(PySSLMemoryBIO *self)
5250
5275
@critical_section
5251
5276
@getter
5252
5277
_ssl.MemoryBIO.eof
5278
+
5279
+ Whether the memory BIO is at EOF.
5253
5280
[clinic start generated code]*/
5254
5281
5255
5282
static PyObject *
5256
5283
_ssl_MemoryBIO_eof_get_impl (PySSLMemoryBIO * self )
5257
- /*[clinic end generated code: output=c255a9ea16e31b92 input=0f5c6be69752e04c ]*/
5284
+ /*[clinic end generated code: output=c255a9ea16e31b92 input=c6ecc12c4509de1f ]*/
5258
5285
{
5259
5286
size_t pending = BIO_ctrl_pending (self -> bio );
5260
5287
return PyBool_FromLong ((pending == 0 ) && self -> eof_written );
@@ -5495,11 +5522,13 @@ PySSLSession_clear(PySSLSession *self)
5495
5522
@critical_section
5496
5523
@getter
5497
5524
_ssl.SSLSession.time
5525
+
5526
+ Session creation time (seconds since epoch).
5498
5527
[clinic start generated code]*/
5499
5528
5500
5529
static PyObject *
5501
5530
_ssl_SSLSession_time_get_impl (PySSLSession * self )
5502
- /*[clinic end generated code: output=4b887b9299de9be4 input=8d1e4afd09103279 ]*/
5531
+ /*[clinic end generated code: output=4b887b9299de9be4 input=67f2325284450ae2 ]*/
5503
5532
{
5504
5533
#if OPENSSL_VERSION_NUMBER >= 0x30300000L
5505
5534
return _PyLong_FromTime_t (SSL_SESSION_get_time_ex (self -> session ));
@@ -5512,11 +5541,13 @@ _ssl_SSLSession_time_get_impl(PySSLSession *self)
5512
5541
@critical_section
5513
5542
@getter
5514
5543
_ssl.SSLSession.timeout
5544
+
5545
+ Session timeout (delta in seconds).
5515
5546
[clinic start generated code]*/
5516
5547
5517
5548
static PyObject *
5518
5549
_ssl_SSLSession_timeout_get_impl (PySSLSession * self )
5519
- /*[clinic end generated code: output=82339c148ab2f7d1 input=ae5e84a9d85df60d ]*/
5550
+ /*[clinic end generated code: output=82339c148ab2f7d1 input=cd17c2b087c442f2 ]*/
5520
5551
{
5521
5552
long timeout = SSL_SESSION_get_timeout (self -> session );
5522
5553
PyObject * res = PyLong_FromLong (timeout );
@@ -5527,11 +5558,13 @@ _ssl_SSLSession_timeout_get_impl(PySSLSession *self)
5527
5558
@critical_section
5528
5559
@getter
5529
5560
_ssl.SSLSession.ticket_lifetime_hint
5561
+
5562
+ Ticket life time hint.
5530
5563
[clinic start generated code]*/
5531
5564
5532
5565
static PyObject *
5533
5566
_ssl_SSLSession_ticket_lifetime_hint_get_impl (PySSLSession * self )
5534
- /*[clinic end generated code: output=c8b6db498136c275 input=d0e06942ddd8d07f ]*/
5567
+ /*[clinic end generated code: output=c8b6db498136c275 input=f0e2df50961a7806 ]*/
5535
5568
{
5536
5569
unsigned long hint = SSL_SESSION_get_ticket_lifetime_hint (self -> session );
5537
5570
return PyLong_FromUnsignedLong (hint );
@@ -5541,11 +5574,13 @@ _ssl_SSLSession_ticket_lifetime_hint_get_impl(PySSLSession *self)
5541
5574
@critical_section
5542
5575
@getter
5543
5576
_ssl.SSLSession.id
5577
+
5578
+ Session ID.
5544
5579
[clinic start generated code]*/
5545
5580
5546
5581
static PyObject *
5547
5582
_ssl_SSLSession_id_get_impl (PySSLSession * self )
5548
- /*[clinic end generated code: output=c532fb96b10c5adf input=e7322372cf6325dd ]*/
5583
+ /*[clinic end generated code: output=c532fb96b10c5adf input=0a379e64312b776d ]*/
5549
5584
5550
5585
{
5551
5586
const unsigned char * id ;
@@ -5558,11 +5593,13 @@ _ssl_SSLSession_id_get_impl(PySSLSession *self)
5558
5593
@critical_section
5559
5594
@getter
5560
5595
_ssl.SSLSession.has_ticket
5596
+
5597
+ Does the session contain a ticket?
5561
5598
[clinic start generated code]*/
5562
5599
5563
5600
static PyObject *
5564
5601
_ssl_SSLSession_has_ticket_get_impl (PySSLSession * self )
5565
- /*[clinic end generated code: output=aa3ccfc40b10b96d input=1a48ae8955fa9601 ]*/
5602
+ /*[clinic end generated code: output=aa3ccfc40b10b96d input=fa475555f53a5086 ]*/
5566
5603
{
5567
5604
int res = SSL_SESSION_has_ticket (self -> session );
5568
5605
return res ? Py_True : Py_False ;
0 commit comments