SSL_set_fd.pod 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. =pod
  2. =head1 NAME
  3. SSL_set_fd - connect the SSL object with a file descriptor
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. int SSL_set_fd(SSL *ssl, int fd);
  7. int SSL_set_rfd(SSL *ssl, int fd);
  8. int SSL_set_wfd(SSL *ssl, int fd);
  9. =head1 DESCRIPTION
  10. SSL_set_fd() sets the file descriptor B<fd> as the input/output facility
  11. for the TLS/SSL (encrypted) side of B<ssl>. B<fd> will typically be the
  12. socket file descriptor of a network connection.
  13. When performing the operation, a B<socket BIO> is automatically created to
  14. interface between the B<ssl> and B<fd>. The BIO and hence the SSL engine
  15. inherit the behaviour of B<fd>. If B<fd> is non-blocking, the B<ssl> will
  16. also have non-blocking behaviour.
  17. If there was already a BIO connected to B<ssl>, BIO_free() will be called
  18. (for both the reading and writing side, if different).
  19. SSL_set_rfd() and SSL_set_wfd() perform the respective action, but only
  20. for the read channel or the write channel, which can be set independently.
  21. =head1 RETURN VALUES
  22. The following return values can occur:
  23. =over 4
  24. =item Z<>0
  25. The operation failed. Check the error stack to find out why.
  26. =item Z<>1
  27. The operation succeeded.
  28. =back
  29. =head1 SEE ALSO
  30. L<SSL_get_fd(3)|SSL_get_fd(3)>, L<SSL_set_bio(3)|SSL_set_bio(3)>,
  31. L<SSL_connect(3)|SSL_connect(3)>, L<SSL_accept(3)|SSL_accept(3)>,
  32. L<SSL_shutdown(3)|SSL_shutdown(3)>, L<ssl(3)|ssl(3)> , L<bio(3)|bio(3)>
  33. =cut