git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/2] imap-send: let OpenSSL do the hostname verification

From
XDXiangfei Ding <xfding@google.com>
Date
Oct 16, 2026, 10:56 UTC
Message-ID
<CABtdbskPaYgVnV+5P7-0G8KVYK1FBekwe2ygoYkZcvCR3RXj8Q@mail.gmail.com>
In-Reply-To
<20261012220039.136932-1-aniketgupta3001@gmail.com>
Hello Beat and Aniket,
> I don't think this can be reached. With SSL_VERIFY_PEER, SSL_connect()
> already fails, so a hostname mismatch would only print "certificate
> verify failed". It does not name the host like the old code did. Could
> we print the verify result when SSL_connect() fails?

I suppose that we will have to install a callback at SSL_set_verify, from which we could leave the bad hostname in a "mailbox" so that in case SSL_connect() fails we could pick it up and print it out.

Would you mind me posting a patch on top of yours?

Best, Xiang

On Tue, Oct 13, 2026 at 12:00 AM Aniket Gupta <aniketgupta3001@gmail.com> wrote:
Show 14 quoted lines
>
> Hello Beat,
>
> > +             long res = SSL_get_verify_result(sock->ssl);
> > +             if (res != X509_V_OK)
> > +                     return error("unable to verify peer certificate: %s",
>
> I don't think this can be reached. With SSL_VERIFY_PEER, SSL_connect()
> already fails, so a hostname mismatch would only print "certificate
> verify failed". It does not name the host like the old code did. Could
> we print the verify result when SSL_connect() fails?
>
> Thanks,
> Aniket
Previous: Aniket GuptaNext: Patrick Steinhardt
Message 22 of 23 in “imap-send: future proofing and two correctness fixes”
  1. 0/3 imap-send: future proofing and two correctness fixesBeat Bolli, Sep 7, 2026
  2. 3/3 imap-send: only check the CN if no SAN DNS names are presentBeat Bolli, Sep 7, 2026
  3. brian m. carlsonSep 8, 2026
  4. 2/3 imap-send: don't expect an ASN1_STRING to be NUL-terminatedBeat Bolli, Sep 7, 2026
  5. Junio C HamanoSep 8, 2026
  6. Patrick SteinhardtSep 8, 2026
  7. 1/3 imap-send: prepare for OpenSSL 4.1Beat Bolli, Sep 7, 2026
  8. Junio C HamanoSep 8, 2026
  9. Patrick SteinhardtSep 8, 2026
  10. Beat BolliSep 14, 2026
  11. Patrick SteinhardtSep 23, 2026
  12. 1/2 imap-send: use the recommended TLS_method()Beat Bolli, Oct 12, 2026
  13. 1/3 imap-send: use the recommended TLS_method()Beat Bolli, Oct 17, 2026
  14. 2/3 imap-send: let OpenSSL do the hostname verificationBeat Bolli, Oct 17, 2026
  15. Patrick SteinhardtOct 19, 2026
  16. Xiangfei DingOct 19, 2026
  17. 3/3 imap-send: prepare for OpenSSL 4.0Beat Bolli, Oct 17, 2026
  18. Patrick SteinhardtOct 19, 2026
  19. Patrick SteinhardtOct 19, 2026
  20. 2/2 imap-send: let OpenSSL do the hostname verificationBeat Bolli, Oct 12, 2026
  21. Aniket GuptaOct 12, 2026
  22. Xiangfei DingOct 16, 2026
  23. Patrick SteinhardtOct 13, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.