I am writing a program in my computer science class and I have come across an error when trying to obtain the public IPv4 address of the computer.
This is my code:
Private Function GetMyIP() As Net.IPAddress
Using wc As New Net.WebClient
Return Net.IPAddress.Parse(Encoding.ASCII.GetString(wc.DownloadData("http://tools.feron.it/php/ip.php")))
End Using
End Function
This is then called using this code:
tboxPublicIPv4.Text = GetMyIP().ToString
However, when it tries to write the IPv4 address to the textbox I get this error:
An unhandled exception of type 'System.Net.WebException' occurred in System.dll
Additional information: The request was aborted: Could not create SSL/TLS secure channel.
Any help would be appreciated. Thank you.