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

Re: [PATCH v2 2/2] send-email: introduce sendemail.smtpsslcertpath

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 6, 2013, 06:25 UTC
Message-ID
<7v1u7c6w7z.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130705184333.GN9161@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
> I'd rather have '$smtp_ssl_cert_path ne ""' in the first if condition
> (instead of the '-d $smtp_ssl_cert_path') ...

I agree. The signal for "no certs" should be an explicit "nonsense" value like an empty string, not just a string that does not name an expected filesystem object. Otherwise people can misspell paths and disable the validation by accident.

> Perhaps a complete solution could allow CA files as well.

Yes, that would be a good idea. Care to roll into a "fixup!" patch against [2/2]?

Show 13 quoted lines
> 	if (defined $smtp_ssl_cert_path) {
> 		if ($smtp_ssl_cert_path eq "") {
> 			return (SSL_verify_mode => SSL_VERIFY_NONE);
> 		} elsif (-f $smtp_ssl_cert_path) {
> 			return (SSL_verify_mode => SSL_VERIFY_PEER,
> 				SSL_ca_file => $smtp_ssl_cert_path);
> 		} else {
> 			return (SSL_verify_mode => SSL_VERIFY_PEER,
> 				SSL_ca_path => $smtp_ssl_cert_path);
> 		}
> 	} else {
> 		return (SSL_verify_mode => SSL_VERIFY_PEER);
> 	}
Two things that worry me a bit are:
 (1) At the end user UI level, it may look nice to accept some form
     of --no-option-name to say "I have been using SSL against my
     server with handrolled cert, and I want to keep using the
     verify-none option"; "--ssl-cert-path=" looks somewhat ugly.
     The same goes for [sendemail] ssl_cert_path = "" config.
 (2) How loudly does the new code barf when no configuration is done
     (i.e. we just pass SSL_VERIFY_PEER and let the system default
     CA path to take effect) and the server cert does not validate?
     The warning that triggered this thread, if we had the
     configuration mechanism we have been designing together, would
     have been a good reminder for the user to use it, but would we
     give a similar (less noisy is fine, as long as it is clear)
     diagnostic message?
Previous: John KeepingNext: John Keeping
Message 26 of 32 in “Squelch warning from send-email”
  1. 0/2 Squelch warning from send-emailRamkumar Ramachandra, Jul 5, 2013
  2. 1/2 send-email: squelch warning from Net::SMTP::SSLRamkumar Ramachandra, Jul 5, 2013
  3. Torsten BögershausenJul 6, 2013
  4. brian m. carlsonJul 6, 2013
  5. Torsten BögershausenJul 6, 2013
  6. Ramkumar RamachandraJul 14, 2013
  7. brian m. carlsonJul 14, 2013
  8. Ramkumar RamachandraJul 14, 2013
  9. Torsten BögershausenJul 15, 2013
  10. Junio C HamanoJul 15, 2013
  11. send-email: improve SSL certificate verificationbrian m. carlson, Jul 16, 2013
  12. Torsten BögershausenJul 16, 2013
  13. brian m. carlsonJul 16, 2013
  14. Re* [PATCH] send-email: improve SSL certificate verificationJunio C Hamano, Jul 18, 2013
  15. Ramkumar RamachandraJul 18, 2013
  16. 2/2 send-email: introduce sendemail.smtpsslcertpathRamkumar Ramachandra, Jul 5, 2013
  17. Eric SunshineJul 5, 2013
  18. Ramkumar RamachandraJul 5, 2013
  19. brian m. carlsonJul 5, 2013
  20. Ramkumar RamachandraJul 5, 2013
  21. brian m. carlsonJul 5, 2013
  22. Junio C HamanoJul 5, 2013
  23. John KeepingJul 5, 2013
  24. Junio C HamanoJul 5, 2013
  25. John KeepingJul 5, 2013
  26. Junio C HamanoJul 6, 2013
  27. John KeepingJul 6, 2013
  28. Junio C HamanoJul 7, 2013
  29. John KeepingJul 7, 2013
  30. brian m. carlsonJul 5, 2013
  31. Jeff KingJul 7, 2013
  32. Junio C HamanoJul 7, 2013

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.