Skip to content

Commit

Permalink
Use ERR_get_error to get last SSL error in openssl.d
Browse files Browse the repository at this point in the history
Getting last error should return an error code which  is easier to understand
when tranlated into a error string
  • Loading branch information
cifvts committed Sep 26, 2014
1 parent b20c40b commit f1a73a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/vibe/stream/openssl.d
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ final class OpenSSLStream : SSLStream {
private int enforceSSL(int ret, string message)
{
if (ret <= 0) {
auto err = SSL_get_error(m_ssl, ret);
auto err = ERR_get_error();
char[120] ebuf;
ERR_error_string(err, ebuf.ptr);
throw new Exception(format("%s: %s (%s)", message, ebuf.ptr.to!string(), err));
Expand Down

0 comments on commit f1a73a0

Please sign in to comment.