Hi to all,

I have this simple code
    
    
    import std/httpclient, strformat, times
    import std/cmdline
    
    let client = newHttpClient()
    proc startDigitaliso(url: string) =
        let time_start = epochTime()
        let msgNonRisponde = "non risponde"
        try:
            var response = client.request(fmt"https://{url}";, httpMethod = 
HttpGet)
            if response.status == "200 OK":
                echo &"{url:<30}{epochTime()-time_start:>15}"
            else:
                echo &"{url:<30}{msgNonRisponde:>15}"
        except Exception as e:
            echo &"{url:<30}{e.msg:>15}"
        finally:
            client.close()
    
    
    when isMainModule:
        if commandLineParams().len > 0:
            for url in commandLineParams():
                startDigitaliso(url)
        else:
            echo "Serve almeno un url come parametro"
    
    
    Run

When I call a website on a Windows server 2008 r2 server an exception is 
thrown: **Additional info: IO error has occurred in the BIO layer**

I think it depends on the negotiation of the TLS protocol (on the server it is 
TLS 1.2).

_Is it correct?_

The request does not appear in the website log on the Windows server.

**Additional info:**

Using python and request on the same site works fine.

The same site on a Windows Server 2019 responds correctly to the nim code.

I don't know if it makes sense but is there a way to set the TLS protocol to 
use in the get call?

Reply via email to