@@ -248,8 +248,6 @@ mod _ssl {
248248 #[ pyattr]
249249 const VERIFY_DEFAULT : u32 = 0 ;
250250 #[ pyattr]
251- const SSL_ERROR_EOF : u32 = 8 ; // custom for python
252- #[ pyattr]
253251 const HAS_SNI : bool = true ;
254252 #[ pyattr]
255253 const HAS_ECDH : bool = true ;
@@ -3391,15 +3389,8 @@ mod _ssl {
33913389 Some ( io_err) => return io_err. to_pyexception ( vm) ,
33923390 // When no I/O error and OpenSSL error queue is empty,
33933391 // this is an EOF in violation of protocol -> SSLEOFError
3394- // Need to set args[0] = SSL_ERROR_EOF for suppress_ragged_eofs check
33953392 None => {
3396- return vm
3397- . new_os_subtype_error (
3398- PySSLEOFError :: class ( & vm. ctx ) . to_owned ( ) ,
3399- Some ( SSL_ERROR_EOF as i32 ) ,
3400- "EOF occurred in violation of protocol" ,
3401- )
3402- . upcast ( ) ;
3393+ return create_ssl_eof_error ( vm) . upcast ( ) ;
34033394 }
34043395 } ,
34053396 ssl:: ErrorCode :: SSL => {
@@ -3412,13 +3403,7 @@ mod _ssl {
34123403 let reason = sys:: ERR_GET_REASON ( err_code) ;
34133404 let lib = sys:: ERR_GET_LIB ( err_code) ;
34143405 if lib == ERR_LIB_SSL && reason == SSL_R_UNEXPECTED_EOF_WHILE_READING {
3415- return vm
3416- . new_os_subtype_error (
3417- PySSLEOFError :: class ( & vm. ctx ) . to_owned ( ) ,
3418- Some ( SSL_ERROR_EOF as i32 ) ,
3419- "EOF occurred in violation of protocol" ,
3420- )
3421- . upcast ( ) ;
3406+ return create_ssl_eof_error ( vm) . upcast ( ) ;
34223407 }
34233408 }
34243409 return convert_openssl_error ( vm, ssl_err. clone ( ) ) ;
0 commit comments