19 Kasım 2018 Pazartesi

Visual Studio- Hata : the underlying connection was closed an unexpected error occurred on a send and (407) Proxy Authentication Required.

Güvenli bir ağ üzerinden proxy yetkilendirmeli bir ağdan dış servise bağlanma sırasında alınan hata cözümü :

app.config eklen

<system.net>
    <defaultProxy useDefaultCredentials="true" >
    </defaultProxy>
</system.net>

Clinet Kullanmadan önce aşağıdaki kodu uygun bir yere yerleştirin . TLS 1.2 için 
            System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072;

If you are stuck with .Net 4.0 and the target site is using TLS 1.2, you need the following line instead. ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;