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

Default SSL Options not Getting picked. #491

Open
apoorv-2204 opened this issue Sep 18, 2024 · 0 comments
Open

Default SSL Options not Getting picked. #491

apoorv-2204 opened this issue Sep 18, 2024 · 0 comments

Comments

@apoorv-2204
Copy link

apoorv-2204 commented Sep 18, 2024

I was getting an error

[warning] Description: 'Authenticity is not established by certificate path validation'
Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing'

I am not sure if its caused by HTTPoison, as The default ssl options are not getting picked.

 defp build_hackney_options(module, %Request{options: options}) do
    timeout = Keyword.get(options, :timeout)
    recv_timeout = Keyword.get(options, :recv_timeout)
    stream_to = Keyword.get(options, :stream_to)
    async = Keyword.get(options, :async)

    ssl =
      if Keyword.get(options, :ssl) do
        default_ssl_options()
        |> Keyword.merge(Keyword.get(options, :ssl))
      else
        Keyword.get(options, :ssl_override)
      end

      IO.inspect("==============")
      IO.inspect(ssl)
      IO.inspect("==============")

...

```elixir
iex(2)> HTTPoison.get("www.google.com")
"=============="
nil
"=============="
{:ok,
 %HTTPoison.Response{
   status_code: 200,
   body: "<!doctype html><html itemscope=\"\" itemtype=\"http://schema.org/WebPage\" lang=\"en-IN\"><head><meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\"><meta content=\"/images/branding/googleg/1x/googleg_standard_color_128dp.png\" itemprop=\"image\"><title>Google</title><script nonce=\"MTZhhsRsgEwSggGjOyB4lg\">(function(){var _g={kEI:'cOnqZqeiLYWfvr0Py9SxqQE',kEXPI:'0,3700303,646,432,3,45,538616,2872,2891,43028,30022,16105,18165,162433,23024,6700,41945,54824,2913,2,2,1,26632,8155,23351,22435,9779,62658,6049,27515,35066,7578,15816,1804,7734,27534,13448,13493,15784,11106,3075,12902,5203210,10464,145,4,5989422,1861,2841776,27980359,16673,43886,3,1603,3,2124363,23029351,8163,10248,88,10736,84045,16825,5798,15164,8181,14873,34557,21669,6755,155,2,2482,13416,87,7736,7042,2098,4599,328,3217,4,1238,1766,1117,1830,4639,5,6376,6634,7389,5633,687,2749,2,5045,3,5,47,22,2941,2695,4479,1347,545,24,4166,2241,3544,682,451,208,5849,5943,1915,2213,2,9,4770,4504,4134,2379,1484,981,528,2767,736,8677,4,258,11517,575,473,797,2388,453,185,1519,1239,2439,4,450,1,2648,1834,892,1019,988,82,144,4,3,578,6487,4180,3874,121,149,287,2,3,3345,895,848,126,371,977,3,1539,251,597,741,1061,300,204,10,398,387,15,645,218,1137,3,2,543,484,23,90,1402,3283,221,893,828,1259,691,2,2,3,1063,388,41,685,707,287,247,4,2,3,626,191,307,2102,379,81,1019,1876,3365,1358,384,64,2,1885,20,122,50,494,632,573,8,1,1,4,1,4,319,47,8,11,654,77,350,114,69,191,724,92,20,448,147,4,99,76,364,137,2,121,220,1954,414,234,106,85,69,147,324,144,988,389,52,1,481,561,810,128,618,616,2,5,2,320,36,4,1,6,104,35,566,983,133,299,119,317,385,1,3,7,48,201,426,253,461,3,234,780,36,639,2,32,257,318,224,9,342,58,1637,233,7,26,758,107,65,494,2952,986,2,21455780,3,1423,3,10836,3639,3,7328,9665,21,1999',kBL:'H3iw',kOPI:89978449};(function(){var a;((a=window.google)==null?0:a.stvsc)?google.kEI=_g.kEI:window.google=_g;}).call(this);})();(function(){google.sn='webhp';google.kHL='en-IN';})();(function(){\nvar h=this||self;function l(){return window.google!==void 0&&window.google.kOPI!==void 0&&window.google.kOPI!==0?window.google.kOPI:null};var m,n=[];function p(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute(\"eid\")));)a=a.parentNode;return b||m}function q(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute(\"leid\")));)a=a.parentNode;return b}function r(a){/^http:/i.test(a)&&window.location.protocol===\"https:\"&&(google.ml&&google.ml(Error(\"a\"),!1,{src:a,glmm:1}),a=\"\");return a}\nfunction t(a,b,c,d,k){var e=\"\";b.search(\"&ei=\")===-1&&(e=\"&ei=\"+p(d),b.search(\"&lei=\")===-1&&(d=q(d))&&(e+=\"&lei=\"+d));d=\"\";var g=b.search(\"&cshid=\")===-1&&a!==\"slh\",f=[];f.push([\"zx\",Date.now().toString()]);h._cshid&&g&&f.push([\"cshid\",h._cshid]);c=c();c!=null&&f.push([\"opi\",c.toString()]);for(c=0;c<f.length;c++){if(c===0||c>0)d+=\"&\";d+=f[c][0]+\"=\"+f[c][1]}return\"/\"+(k||\"gen_204\")+\"?atyp=i&ct=\"+String(a)+\"&cad=\"+(b+e+d)};m=google.kEI;google.getEI=p;google.getLEI=q;google.ml=function(){return null};google.log=function(a,b,c,d,k,e){e=e===void 0?l:e;c||(c=t(a,b,e,d,k));if(c=r(c)){a=new Image;var g=n.length;n[g]=a;a.onerror=a.onload=a.onabort=function(){delete n[g]};a.src=c}};google.logUrl=function(a,b){b=b===void 0?l:b;return t(\"\",a,b)};}).call(this);(function(){google.y={};google.sy=[];var d;(d=google).x||(d.x=function(a,b){if(a)var c=a.id;else{do c=Math.random();while(google.y[c])}google.y[c]=[a,b];return!1});var e;(e=google).sx||(e.sx=function(a){google.sy.push(a)});google.lm=[];var f;(f=google).plm||(f.plm=function(a){google.lm.push.apply(google.lm,a)});google.lq=[];var g;(g=google).load||(g.load=function(a,b,c){google.lq.push([[a],b,c])});var h;(h=google).loadAll||(h.loadAll=function(a,b){google.lq.push([a,b])});google.bx=!1;var k;(k=google).lx||(k.lx=function(){});var l=[],m;(m=google).fce||(m.fce=function(a,b,c,n){l.push([a,b,c,n])});google.qce=l;}).call(this);google.f={};(function(){\ndocument.documentElement.addEventListener(\"submit\",function(b){var a;if(a=b.target){var c=a.getAttribute(\"data-submitfalse\");a=c===\"1\"||c===\"q\"&&!a.elements.q.value?!0:!1}else a=!1;a&&(b.preventDefault(),b.stopPropagation())},!0);document.d" <> ...,
   headers: [
     {"Date", "Wed, 18 Sep 2024 14:53:36 GMT"},
     {"Expires", "-1"},
     {"Cache-Control", "private, max-age=0"},
     {"Content-Type", "text/html; charset=ISO-8859-1"},
     {"Content-Security-Policy-Report-Only",
      "object-src 'none';base-uri 'self';script-src 'nonce-MTZhhsRsgEwSggGjOyB4lg' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp"},
     {"P3P", "CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\""},
     {"Server", "gws"},
     {"X-XSS-Protection", "0"},
     {"X-Frame-Options", "SAMEORIGIN"},
     {"Set-Cookie",
      "AEC=AVYB7crBtEnZjI7SW_NMRcNyp_3-WbCWqbORVXV3seXjWIXa8ZUdlhsCFQ; expires=Mon, 17-Mar-2025 14:53:36 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax"},
     {"Set-Cookie",
      "NID=517=t4FBSJ0Lk4hk5bHKof1K5093Pgnrem5j3zXZ3lWuQuBQr4HqQBzYhCz-vOkzmt1rklEdW22TOGoNw1muycBPzMAkJd1DK34WBuTf83Un0eDgr3FKY0MBs-1IHBY6nkSuT7JCqlvkJjfkJLB-qkKALSUxtYzTuWC2alW4KQ_c_hn1XXpVk5oo689zKeg0bNWohfo; expires=Thu, 20-Mar-2025 14:53:36 GMT; path=/; domain=.google.com; HttpOnly"},
     {"Accept-Ranges", "none"},
     {"Vary", "Accept-Encoding"},
     {"Transfer-Encoding", "chunked"}
   ],
   request_url: "http://www.google.com",
   request: %HTTPoison.Request{
     method: :get,
     url: "http://www.google.com",
     headers: [],
     body: "",
     params: %{},
     options: []
   }
 }}
iex(3)> ```

ssl Headers not showing up in the requests

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

No branches or pull requests

1 participant