Commit 6d5c233
committed
💥 Don't set verify_callback to VerifyCallbackProc
The `VerifyCallbackProc` constant will no longer be automatically
assigned to `context.verify_callback`.
The callback can still be set explicitly:
```
imap = Net::IMAP.new(host, ssl: {verify_callback: VerifyCallbackProc})
imap.starttls(verify_callback: VerifyCallbackProc)
```
Prior to this commit, if `VerifyCallbackProc` were set (it could be any
of `Net::IMAP::VerifyCallbackProc`, `OpenSSL::SSL::VerifyCallbackProc`,
`OpenSSL::VerifyCallbackProc`, `Net::VerifyCallbackProc`, or
`::VerifyCallbackProc`), it would automatically be assigned to
`context.verify_callback`. I can't find any evidence that this constant
has ever been set for `net-imap`, `openssl`, or ruby. But it _is_ also
used by `net-ftp`.
This functionality existed from the beginning of `net-imap`'s TLS
support, but was never documented. I don't know the original motivation
for this. (Perhaps it's still useful for inserting a debug logger?) But
I'm guessing that past motivations for this code are less significant
now. Earlier versions of ruby's `openssl` did not have very secure
defaults, but the modern `openssl` gem already handles the verify
callback just fine.1 parent 3bba1c0 commit 6d5c233
1 file changed
+0
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3780 | 3780 | | |
3781 | 3781 | | |
3782 | 3782 | | |
3783 | | - | |
3784 | | - | |
3785 | | - | |
3786 | 3783 | | |
3787 | 3784 | | |
3788 | 3785 | | |
| |||
0 commit comments