Commit a77ed4b
committed
ssl: deprecate OpenSSL::SSL::SSLServer
Although OpenSSL::SSL::SSLServer presents itself as a TCPServer-like
wrapper, its design has flaws. Document OpenSSL::SSL::SSLServer as
deprecated and recommend using OpenSSL::SSL::SSLSocket directly.
SSLServer#accept calls #accept on the underlying listening socket and
then performs the TLS handshake synchronously. This is an obvious
problem for programs that expect more than one client to connect.
Fixing this would require keeping a backlog of accepted TCP connections
in SSLServer while their TLS handshakes complete, which would be too
significant a change.
This is also why SSLServer#accept_nonblock was never implemented.
The blocking behavior of #accept can be worked around by setting
SSLServer#start_immediately to false, which skips the handshake.
However, at that point SSLServer provides little value over using
TCPServer directly and wrapping each accepted socket with SSLSocket.1 parent 2c109b2 commit a77ed4b
2 files changed
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
947 | | - | |
948 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
949 | 950 | | |
950 | 951 | | |
951 | 952 | | |
952 | 953 | | |
953 | | - | |
954 | 954 | | |
955 | 955 | | |
956 | | - | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
957 | 961 | | |
958 | 962 | | |
959 | 963 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
478 | 482 | | |
479 | 483 | | |
480 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
481 | 491 | | |
482 | 492 | | |
483 | 493 | | |
| |||
511 | 521 | | |
512 | 522 | | |
513 | 523 | | |
| 524 | + | |
| 525 | + | |
514 | 526 | | |
515 | 527 | | |
516 | 528 | | |
| |||
0 commit comments