summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-05-01 09:53:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-05-01 09:53:37 -0300
commit4dc4e96c8a4fb7e34ecae3a39ef0f3f3fb275e97 (patch)
tree73da4d4d6d0fa1b4c6761a63ac3674aead8b12e3 /core/io
parent5ab65f0eadec6a67eda622787206a01c8af2cf7e (diff)
-OpenSSL Fixes
Diffstat (limited to 'core/io')
-rw-r--r--core/io/http_client.cpp7
-rw-r--r--core/io/http_client.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 59bc5802ea..27e202f47f 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -34,7 +34,7 @@ Error HTTPClient::connect_url(const String& p_url) {
return OK;
}
-Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl){
+Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl,bool p_verify_host){
close();
conn_port=p_port;
@@ -50,6 +50,7 @@ Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl){
ssl=p_ssl;
+ ssl_verify_host=p_verify_host;
connection=tcp_connection;
@@ -239,7 +240,7 @@ Error HTTPClient::poll(){
case StreamPeerTCP::STATUS_CONNECTED: {
if (ssl) {
Ref<StreamPeerSSL> ssl = StreamPeerSSL::create();
- Error err = ssl->connect(tcp_connection,true,conn_host);
+ Error err = ssl->connect(tcp_connection,true,ssl_verify_host?conn_host:String());
if (err!=OK) {
close();
status=STATUS_SSL_HANDSHAKE_ERROR;
@@ -553,7 +554,7 @@ bool HTTPClient::is_blocking_mode_enabled() const{
void HTTPClient::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("connect:Error","host","port","use_ssl"),&HTTPClient::connect,DEFVAL(false));
+ ObjectTypeDB::bind_method(_MD("connect:Error","host","port","use_ssl"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true));
ObjectTypeDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection);
ObjectTypeDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String()));
ObjectTypeDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text);
diff --git a/core/io/http_client.h b/core/io/http_client.h
index 7e60052319..09ad64f48a 100644
--- a/core/io/http_client.h
+++ b/core/io/http_client.h
@@ -137,6 +137,7 @@ private:
int conn_port;
String conn_host;
bool ssl;
+ bool ssl_verify_host;
bool blocking;
Vector<uint8_t> response_str;
@@ -161,7 +162,7 @@ public:
Error connect_url(const String& p_url); //connects to a full url and perform request
- Error connect(const String &p_host,int p_port,bool p_ssl=false);
+ Error connect(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true);
void set_connection(const Ref<StreamPeer>& p_connection);