From a50adf556a0088a8b6833c7a9b745ea4c0db4a2d Mon Sep 17 00:00:00 2001 From: Alisina Bahadori Date: Wed, 21 Nov 2018 16:48:00 +0330 Subject: [PATCH] Fix https in soap_parse_wsdl and soap_pars_wsdl_2_0 --- src/soap_parse_wsdl.erl | 9 +++++++++ src/soap_parse_wsdl_2_0.erl | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/soap_parse_wsdl.erl b/src/soap_parse_wsdl.erl index 4598a58..6bf4279 100644 --- a/src/soap_parse_wsdl.erl +++ b/src/soap_parse_wsdl.erl @@ -614,6 +614,15 @@ get_url_file("http://"++_ = URL) -> {error, _Reason} -> {error, "failed to retrieve: "++URL} end; +get_url_file("https://"++_ = URL) -> + case httpc:request(URL) of + {ok,{{_HTTP,200,_OK}, _Headers, Body}} -> + {ok, Body}; + {ok,{{_HTTP, _RC, _Emsg}, _Headers, _Body}} -> + {error, "failed to retrieve: "++URL}; + {error, _Reason} -> + {error, "failed to retrieve: "++URL} + end; get_url_file("file://" ++ F_name) -> case file:read_file(F_name) of {ok, Bin} -> diff --git a/src/soap_parse_wsdl_2_0.erl b/src/soap_parse_wsdl_2_0.erl index 8c11987..7749fcc 100644 --- a/src/soap_parse_wsdl_2_0.erl +++ b/src/soap_parse_wsdl_2_0.erl @@ -376,6 +376,15 @@ get_url_file("http://"++_ = URL, _Options) -> {error, _Reason} -> {error, "failed to retrieve: "++URL} end; +get_url_file("https://"++_ = URL, _Options) -> + case httpc:request(URL) of + {ok,{{_HTTP,200,_OK}, _Headers, Body}} -> + {ok, Body}; + {ok,{{_HTTP,_RC,_Emsg}, _Headers, _Body}} -> + {error, "failed to retrieve: "++URL}; + {error, _Reason} -> + {error, "failed to retrieve: "++URL} + end; get_url_file("file://" ++ F_name, Options) -> File_name = case proplists:get_value(include_path, Options) of