better error messages
This commit is contained in:
parent
af92d1f870
commit
99ecd586d4
|
|
@ -175,7 +175,7 @@ int HttpClient::sslRequest(const std::string &server_name, const std::string &re
|
||||||
int s;
|
int s;
|
||||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
printf("MlError creating socket.\n");
|
printf("sslRequest, error creating socket.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,7 +190,7 @@ int HttpClient::sslRequest(const std::string &server_name, const std::string &re
|
||||||
|
|
||||||
// connect to server
|
// connect to server
|
||||||
if (connect(s, (struct sockaddr *) &sa, socklen)) {
|
if (connect(s, (struct sockaddr *) &sa, socklen)) {
|
||||||
printf("MlError connecting to server.\n");
|
printf("sslRequest, error connecting to server.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,7 +201,7 @@ int HttpClient::sslRequest(const std::string &server_name, const std::string &re
|
||||||
SSL_CTX *ctx = SSL_CTX_new(meth);
|
SSL_CTX *ctx = SSL_CTX_new(meth);
|
||||||
ssl = SSL_new(ctx);
|
ssl = SSL_new(ctx);
|
||||||
if (!ssl) {
|
if (!ssl) {
|
||||||
printf("MlError creating SSL.\n");
|
printf("sslRequest, error creating SSL.\n");
|
||||||
log_ssl();
|
log_ssl();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -212,7 +212,7 @@ int HttpClient::sslRequest(const std::string &server_name, const std::string &re
|
||||||
|
|
||||||
int err = SSL_connect(ssl);
|
int err = SSL_connect(ssl);
|
||||||
if (err <= 0) {
|
if (err <= 0) {
|
||||||
printf("MlError creating SSL connection. err=%x\n", err);
|
printf("sslRequest, error creating SSL connection. err=%x\n", err);
|
||||||
log_ssl();
|
log_ssl();
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue