Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

The request was aborted: Could not create SSL/TLS secure channel.

Posted on 2014-10-29
3
Medium Priority
?
1,263 Views
Last Modified: 2014-11-10
im trying to call this url
gateway.sandbox.push.apple.com:2195


 using this code

  Dim request As HttpWebRequest = TryCast(HttpWebRequest.Create("https://gateway.sandbox.push.apple.com:2195"), HttpWebRequest)

        If request IsNot Nothing Then
            request.Method = "GET"
            request.KeepAlive = False
            request.ProtocolVersion = HttpVersion.Version10
            Dim webProxy = New System.Net.WebProxy("ip address", True)
            Dim credentials = New NetworkCredential("user name", "password", "domain")

            webProxy.Credentials = credentials
            request.Proxy = webProxy
            Try
                Using response As WebResponse = request.GetResponse()
                    Using stream As Stream = response.GetResponseStream()
                        Using reader As New StreamReader(stream, Encoding.UTF8)
                            content = reader.ReadToEnd()
                        End Using
                    End Using
                End Using
            Catch exc As Exception
                Throw exc
            End Try
        End If

Open in new window


and it is not working

i did the following
    ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf AcceptAllCertifications)
       

   Dim cert As X509Certificate2 = New X509Certificate2(Server.MapPath("mycert.p12"), "password")

and add it to the request but no luck

pls help
0
Comment
Question by:Kamal Khaleefa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Expert Comment

by:David Johnson, CD, MVP
ID: 40412402
I can't get push.apple.com to resolve doing a ns lookup can you?
0
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 0 total points
ID: 40425683
Hi

i solve the problem doing this
 Try


            ServicePointManager.Expect100Continue = False

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls



            Dim request As HttpWebRequest = WebRequest.Create("https://mysiteaddress")

            request.ProtocolVersion = HttpVersion.Version10
            request.KeepAlive = False


            ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf AcceptAllCertifications)

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls





            Dim cert As X509Certificate2 = New X509Certificate2("mycertification path", "password") 'if needed


            request.ClientCertificates.Add(cert)

            request.Method = "POST"


            Dim webProxy = New System.Net.WebProxy("my proxy address if required", True)

            Dim credentials = New NetworkCredential(proxyUserName, proxyPassword, DomainName)


            webProxy.Credentials = credentials ' CredentialCache.DefaultCredentials '; credentials


            request.Proxy = webProxy


            Dim responseStream = request.GetRequestStream

            Debug.Assert(responseStream IsNot Nothing)

         

        




        Catch ex As Exception



        End Try

Open in new window

0
 
LVL 16

Author Closing Comment

by:Kamal Khaleefa
ID: 40432348
This solution works
0

Featured Post

Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question