Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw permanent_failure when TLS fails due to non-started SSL. #71

Merged
merged 2 commits into from
May 16, 2016

Conversation

fdevibe
Copy link
Contributor

@fdevibe fdevibe commented Sep 6, 2014

I spent a bit too much time debugging a temporary_failure, tls_failed error, only to find out that SSL wasn't started. I found this a bit misleading, hence this suggestion to clarify the cause of the failure. Also, I presume permanent_failure would be the correct error type, but I'm not really familiar with the code base, so there may well be better alternatives.

@donpiekarz
Copy link

I like it.
Why ssl wasn't started? I think this is strange.

@mworrell
Copy link
Collaborator

mworrell commented Nov 4, 2014

Reading the code at that point, you might want to add quit(Socket) to close the socket and send the other side a QUIT command.

@donpiekarz
Copy link

Why ssl app wasn't started?

I am starting server:
gen_smtp_server:start(my_server).
And later in gen_smtp_client (with fdevibe's path), when server wants to send an email to gmail:
{error,ssl_not_started}

@fdevibe
Copy link
Contributor Author

fdevibe commented Nov 4, 2014

@donpiekarz that's a good question, I guess. I ended up doing that in my app (which uses gen_smtp), but I didn't have to before. It seems to me gen_smtp should have started SSL, but for some reason it failed. This patch is only intended to improve the error message and ease debugging, though.

@fdevibe
Copy link
Contributor Author

fdevibe commented Nov 4, 2014

@mworrell good catch, thanks! :-)

@arjan arjan merged commit 701dbca into gen-smtp:master May 16, 2016
@arjan
Copy link
Collaborator

arjan commented May 16, 2016

Sorry for the enormous delay! :)

arjan pushed a commit that referenced this pull request Jun 23, 2016
Arjan Scherpenisse (9):
      'rebar3 hex cut' destroyed the .app.src formatting
      Merge pull request #104 from tsloughter/master
      Merge pull request #105 from tsloughter/now_deprecated
      Remove old rebar.test.config
      Merge pull request #71 from fdevibe/master
      Fix #72
      Fix link to OpenACD project
      Merge pull request #106 from zambal/master
      Remove unused nowarn_deprecated_function

Fredrik de Vibe (2):
      Throw permanent_failure when TLS fails due to non-started SSL.
      Close socket and send QUIT also when throwing error because SSL is not started.

Tristan Sloughter (2):
      exclude smtp_rfc822_parse.erl from hex package
      for 18+: remove use of now, replacing with unique_integer

Vincent Siliakus (1):
      Fix -spec's for OTP-19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants