# "Could not create SSL/TLS secure channel" error

![](https://3346503218-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLomF5LRsFBEqyuX095%2F-LsoF5ROdhD1HeyPnSNX%2F-LsoH9hsku2aTPG7RaF4%2Ficons8-re%C3%A7u-refus%C3%A9-64.png?alt=media\&token=476e3502-6ed4-418c-87d8-50c8bc667224)

{% hint style="warning" %}
This error can happen if you use a webClient to access an SSL/TLS secured endpoint.
{% endhint %}

Simply add this code to your method to remove the issue :

{% tabs %}
{% tab title="\[C#]" %}

```csharp
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
```

{% endtab %}

{% tab title="\[VB.NET]" %}

```fsharp
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
```

{% endtab %}
{% endtabs %}
