GraphQLTest: Add Proxy config
This commit is contained in:
@@ -13,9 +13,10 @@ Public Class GraphQLInterface
|
||||
Private _userPassword As String
|
||||
Private _certificate As X509Certificate
|
||||
Private _cookieJar As CookieContainer
|
||||
|
||||
Private _Encoding As New UTF8Encoding
|
||||
|
||||
Public Property Proxy As WebProxy
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, BaseUrl As String, Email As String, Password As String, CertificateFile As String, CertificatePassword As String)
|
||||
Try
|
||||
_logConfig = LogConfig
|
||||
@@ -92,6 +93,9 @@ Public Class GraphQLInterface
|
||||
|
||||
Private Function GetRequest(Url As String, PostData As Byte()) As HttpWebRequest
|
||||
Try
|
||||
ServicePointManager.Expect100Continue = True
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
|
||||
|
||||
Dim oRequest As HttpWebRequest = WebRequest.Create($"{_baseUrl}{Url}")
|
||||
oRequest.Method = "POST"
|
||||
oRequest.ContentType = "application/json"
|
||||
@@ -99,6 +103,10 @@ Public Class GraphQLInterface
|
||||
oRequest.ClientCertificates.Add(_certificate)
|
||||
oRequest.CookieContainer = GetCookies()
|
||||
|
||||
If Proxy IsNot Nothing Then
|
||||
oRequest.Proxy = Proxy
|
||||
End If
|
||||
|
||||
Return oRequest
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
|
||||
Reference in New Issue
Block a user