@@ -2162,11 +2162,17 @@ _ssl__SSLSocket_compression_impl(PySSLSocket *self)
2162
2162
@critical_section
2163
2163
@getter
2164
2164
_ssl._SSLSocket.context
2165
+
2166
+ This changes the context associated with the SSLSocket.
2167
+
2168
+ This is typically used from within a callback function set by the sni_callback
2169
+ on the SSLContext to change the certificate information associated with the
2170
+ SSLSocket before the cryptographic exchange handshake messages.
2165
2171
[clinic start generated code]*/
2166
2172
2167
2173
static PyObject *
2168
2174
_ssl__SSLSocket_context_get_impl (PySSLSocket * self )
2169
- /*[clinic end generated code: output=d23e82f72f32e3d7 input=25aa82e4d9fa344a ]*/
2175
+ /*[clinic end generated code: output=d23e82f72f32e3d7 input=7cbb97407c2ace30 ]*/
2170
2176
{
2171
2177
return Py_NewRef (self -> ctx );
2172
2178
}
@@ -2233,11 +2239,15 @@ _ssl__SSLSocket_server_hostname_get_impl(PySSLSocket *self)
2233
2239
@critical_section
2234
2240
@getter
2235
2241
_ssl._SSLSocket.owner
2242
+
2243
+ The Python-level owner of this object.
2244
+
2245
+ Passed as "self" in servername callback.
2236
2246
[clinic start generated code]*/
2237
2247
2238
2248
static PyObject *
2239
2249
_ssl__SSLSocket_owner_get_impl (PySSLSocket * self )
2240
- /*[clinic end generated code: output=1f278cb930382927 input=bc2861ff3cf1402e ]*/
2250
+ /*[clinic end generated code: output=1f278cb930382927 input=978a8382d9c25c92 ]*/
2241
2251
{
2242
2252
if (self -> owner == NULL ) {
2243
2253
Py_RETURN_NONE ;
@@ -2851,11 +2861,13 @@ _ssl__SSLSocket_verify_client_post_handshake_impl(PySSLSocket *self)
2851
2861
@critical_section
2852
2862
@getter
2853
2863
_ssl._SSLSocket.session
2864
+
2865
+ The underlying SSLSession object.
2854
2866
[clinic start generated code]*/
2855
2867
2856
2868
static PyObject *
2857
2869
_ssl__SSLSocket_session_get_impl (PySSLSocket * self )
2858
- /*[clinic end generated code: output=a5cd5755b35da670 input=b9792df9255a9f63 ]*/
2870
+ /*[clinic end generated code: output=a5cd5755b35da670 input=d427318604244bf8 ]*/
2859
2871
{
2860
2872
/* get_session can return sessions from a server-side connection,
2861
2873
* it does not check for handshake done or client socket. */
@@ -3657,11 +3669,13 @@ _ssl__SSLContext_maximum_version_set_impl(PySSLContext *self,
3657
3669
@critical_section
3658
3670
@getter
3659
3671
_ssl._SSLContext.num_tickets
3672
+
3673
+ Control the number of TLSv1.3 session tickets.
3660
3674
[clinic start generated code]*/
3661
3675
3662
3676
static PyObject *
3663
3677
_ssl__SSLContext_num_tickets_get_impl (PySSLContext * self )
3664
- /*[clinic end generated code: output=3d06d016318846c9 input=1dee26d75163c073 ]*/
3678
+ /*[clinic end generated code: output=3d06d016318846c9 input=1e2599a2e22564ff ]*/
3665
3679
{
3666
3680
// Clinic seems to be misbehaving when the comment is wrapped with in directive
3667
3681
#if defined(TLS1_3_VERSION ) && !defined(OPENSSL_NO_TLS1_3 )
@@ -3705,11 +3719,13 @@ _ssl__SSLContext_num_tickets_set_impl(PySSLContext *self, PyObject *value)
3705
3719
@critical_section
3706
3720
@getter
3707
3721
_ssl._SSLContext.security_level
3722
+
3723
+ The current security level.
3708
3724
[clinic start generated code]*/
3709
3725
3710
3726
static PyObject *
3711
3727
_ssl__SSLContext_security_level_get_impl (PySSLContext * self )
3712
- /*[clinic end generated code: output=56ece09e6a9572d0 input=a0416598e07c3183 ]*/
3728
+ /*[clinic end generated code: output=56ece09e6a9572d0 input=2bdeecb57bb86e3f ]*/
3713
3729
{
3714
3730
PyObject * res = PyLong_FromLong (SSL_CTX_get_security_level (self -> ctx ));
3715
3731
return res ;
@@ -4666,11 +4682,18 @@ _servername_callback(SSL *s, int *al, void *args)
4666
4682
@critical_section
4667
4683
@getter
4668
4684
_ssl._SSLContext.sni_callback
4685
+
4686
+ Set a callback that will be called when a server name is provided by the SSL/TLS client in the SNI extension.
4687
+
4688
+ If the argument is None then the callback is disabled. The method is called
4689
+ with the SSLSocket, the server name as a string, and the SSLContext object.
4690
+
4691
+ See RFC 6066 for details of the SNI extension.
4669
4692
[clinic start generated code]*/
4670
4693
4671
4694
static PyObject *
4672
4695
_ssl__SSLContext_sni_callback_get_impl (PySSLContext * self )
4673
- /*[clinic end generated code: output=961e6575cdfaf036 input=22dd28c31fdc4318 ]*/
4696
+ /*[clinic end generated code: output=961e6575cdfaf036 input=9b2473c5e984cfe6 ]*/
4674
4697
{
4675
4698
PyObject * cb = self -> set_sni_cb ;
4676
4699
if (cb == NULL ) {
@@ -5243,11 +5266,13 @@ memory_bio_dealloc(PySSLMemoryBIO *self)
5243
5266
@critical_section
5244
5267
@getter
5245
5268
_ssl.MemoryBIO.pending
5269
+
5270
+ The number of bytes pending in the memory BIO.
5246
5271
[clinic start generated code]*/
5247
5272
5248
5273
static PyObject *
5249
5274
_ssl_MemoryBIO_pending_get_impl (PySSLMemoryBIO * self )
5250
- /*[clinic end generated code: output=19236a32a51ac8ff input=c0b6d14eba107f6a ]*/
5275
+ /*[clinic end generated code: output=19236a32a51ac8ff input=02d9063d8ac31732 ]*/
5251
5276
{
5252
5277
size_t res = BIO_ctrl_pending (self -> bio );
5253
5278
return PyLong_FromSize_t (res );
@@ -5257,11 +5282,13 @@ _ssl_MemoryBIO_pending_get_impl(PySSLMemoryBIO *self)
5257
5282
@critical_section
5258
5283
@getter
5259
5284
_ssl.MemoryBIO.eof
5285
+
5286
+ Whether the memory BIO is at EOF.
5260
5287
[clinic start generated code]*/
5261
5288
5262
5289
static PyObject *
5263
5290
_ssl_MemoryBIO_eof_get_impl (PySSLMemoryBIO * self )
5264
- /*[clinic end generated code: output=c255a9ea16e31b92 input=0f5c6be69752e04c ]*/
5291
+ /*[clinic end generated code: output=c255a9ea16e31b92 input=c6ecc12c4509de1f ]*/
5265
5292
{
5266
5293
size_t pending = BIO_ctrl_pending (self -> bio );
5267
5294
return PyBool_FromLong ((pending == 0 ) && self -> eof_written );
@@ -5502,11 +5529,13 @@ PySSLSession_clear(PySSLSession *self)
5502
5529
@critical_section
5503
5530
@getter
5504
5531
_ssl.SSLSession.time
5532
+
5533
+ Session creation time (seconds since epoch).
5505
5534
[clinic start generated code]*/
5506
5535
5507
5536
static PyObject *
5508
5537
_ssl_SSLSession_time_get_impl (PySSLSession * self )
5509
- /*[clinic end generated code: output=4b887b9299de9be4 input=8d1e4afd09103279 ]*/
5538
+ /*[clinic end generated code: output=4b887b9299de9be4 input=67f2325284450ae2 ]*/
5510
5539
{
5511
5540
#if OPENSSL_VERSION_NUMBER >= 0x30300000L
5512
5541
return _PyLong_FromTime_t (SSL_SESSION_get_time_ex (self -> session ));
@@ -5519,11 +5548,13 @@ _ssl_SSLSession_time_get_impl(PySSLSession *self)
5519
5548
@critical_section
5520
5549
@getter
5521
5550
_ssl.SSLSession.timeout
5551
+
5552
+ Session timeout (delta in seconds).
5522
5553
[clinic start generated code]*/
5523
5554
5524
5555
static PyObject *
5525
5556
_ssl_SSLSession_timeout_get_impl (PySSLSession * self )
5526
- /*[clinic end generated code: output=82339c148ab2f7d1 input=ae5e84a9d85df60d ]*/
5557
+ /*[clinic end generated code: output=82339c148ab2f7d1 input=cd17c2b087c442f2 ]*/
5527
5558
{
5528
5559
long timeout = SSL_SESSION_get_timeout (self -> session );
5529
5560
PyObject * res = PyLong_FromLong (timeout );
@@ -5534,11 +5565,13 @@ _ssl_SSLSession_timeout_get_impl(PySSLSession *self)
5534
5565
@critical_section
5535
5566
@getter
5536
5567
_ssl.SSLSession.ticket_lifetime_hint
5568
+
5569
+ Ticket life time hint.
5537
5570
[clinic start generated code]*/
5538
5571
5539
5572
static PyObject *
5540
5573
_ssl_SSLSession_ticket_lifetime_hint_get_impl (PySSLSession * self )
5541
- /*[clinic end generated code: output=c8b6db498136c275 input=d0e06942ddd8d07f ]*/
5574
+ /*[clinic end generated code: output=c8b6db498136c275 input=f0e2df50961a7806 ]*/
5542
5575
{
5543
5576
unsigned long hint = SSL_SESSION_get_ticket_lifetime_hint (self -> session );
5544
5577
return PyLong_FromUnsignedLong (hint );
@@ -5548,11 +5581,13 @@ _ssl_SSLSession_ticket_lifetime_hint_get_impl(PySSLSession *self)
5548
5581
@critical_section
5549
5582
@getter
5550
5583
_ssl.SSLSession.id
5584
+
5585
+ Session ID.
5551
5586
[clinic start generated code]*/
5552
5587
5553
5588
static PyObject *
5554
5589
_ssl_SSLSession_id_get_impl (PySSLSession * self )
5555
- /*[clinic end generated code: output=c532fb96b10c5adf input=e7322372cf6325dd ]*/
5590
+ /*[clinic end generated code: output=c532fb96b10c5adf input=0a379e64312b776d ]*/
5556
5591
5557
5592
{
5558
5593
const unsigned char * id ;
@@ -5565,11 +5600,13 @@ _ssl_SSLSession_id_get_impl(PySSLSession *self)
5565
5600
@critical_section
5566
5601
@getter
5567
5602
_ssl.SSLSession.has_ticket
5603
+
5604
+ Does the session contain a ticket?
5568
5605
[clinic start generated code]*/
5569
5606
5570
5607
static PyObject *
5571
5608
_ssl_SSLSession_has_ticket_get_impl (PySSLSession * self )
5572
- /*[clinic end generated code: output=aa3ccfc40b10b96d input=1a48ae8955fa9601 ]*/
5609
+ /*[clinic end generated code: output=aa3ccfc40b10b96d input=fa475555f53a5086 ]*/
5573
5610
{
5574
5611
int res = SSL_SESSION_has_ticket (self -> session );
5575
5612
return res ? Py_True : Py_False ;
0 commit comments