… | |
… | |
685 | Net::SSLeay::set_connect_state ($ssl); |
685 | Net::SSLeay::set_connect_state ($ssl); |
686 | } |
686 | } |
687 | |
687 | |
688 | $self->{tls} = $ssl; |
688 | $self->{tls} = $ssl; |
689 | |
689 | |
|
|
690 | # basically, this is deep magic (because SSL_read should have the same issues) |
|
|
691 | # but the openssl maintainers basically said: "trust us, it just works". |
|
|
692 | # (unfortunately, we have to hardcode constants because the abysmally misdesigned |
|
|
693 | # and mismaintained ssleay-module doesn't even offer them). |
|
|
694 | Net::SSLeay::CTX_set_mode ($self->{tls}, |
|
|
695 | (eval { Net::SSLeay::MODE_ENABLE_PARTIAL_WRITE () } || 1) |
|
|
696 | | (eval { Net::SSLeay::MODE_ACCEPT_MOVING_WRITE_BUFFER () } || 2)); |
|
|
697 | |
690 | $self->{tls_rbio} = Net::SSLeay::BIO_new (Net::SSLeay::BIO_s_mem ()); |
698 | $self->{tls_rbio} = Net::SSLeay::BIO_new (Net::SSLeay::BIO_s_mem ()); |
691 | $self->{tls_wbio} = Net::SSLeay::BIO_new (Net::SSLeay::BIO_s_mem ()); |
699 | $self->{tls_wbio} = Net::SSLeay::BIO_new (Net::SSLeay::BIO_s_mem ()); |
692 | |
700 | |
693 | Net::SSLeay::set_bio ($ssl, $self->{tls_rbio}, $self->{tls_wbio}); |
701 | Net::SSLeay::set_bio ($ssl, $self->{tls_rbio}, $self->{tls_wbio}); |
694 | |
702 | |