none
Odd behavior related to ServicePointManager settings RRS feed

  • Question

  • I have an Outlook VSTO add-in which targets on .NET framework 4.6. ServicePointManager.SecurityProtocol returns me Ssl3, Tls. But when I create console application it returns me Tls, Tls11, Tls12.

    Is it expected behavior?

    Does VSTO or Outlook host affects to this settings and how we can change this behavior.

    Of course, I can add Tls12 to the supported protocols list (since v4.6 supports this protocol), but, when in the near future Tls12 will be compromised, I should change my code. 

    Regards

    Saturday, October 28, 2017 9:35 AM

All replies

  • Hi Hamlet Hakobyan,

    How do you return the ServicePointManager.SecurityProtocol in the add-in? How do you return it in the console application?

    Best Regards,

    Terru


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 31, 2017 3:25 AM
  • Here is the code:

    Debug.WriteLine(ServicePointManager.SecurityProtocol);

    This code resides in the Main method for console app and in ThisAddIn_Startup for add-in.

    Regards,

    Hamlet

    Tuesday, October 31, 2017 12:56 PM
  • Hi Hamlet Hakobyan,

    I failed to reproduce your issue, both the outputs returns  Tls, Tls11, Tls12 in my test. What's the version of your outlook? Did you try to do the test in different pc? 

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 2, 2017 9:12 AM
  • Hi Terry,

    I've tried on different machine, result is the same. Outlook version is 2016 from Office 365 subscription.

    I've tried to disable all other add-ins, result is the same. VSTO installed with Visual studio 2017. VS is up to date.

    Any thought will be appreciated.

    Regards,

    Hamlet

    Friday, November 3, 2017 3:22 PM
  • Hi Hamlet,

    >> ServicePointManager.SecurityProtocol returns me Ssl3, Tls. But when I create console application it returns me Tls, Tls11, Tls12.

    I made a test at my side, and I got the different result. Both outlook VSTO Addin and console application return Ssl3, Tls. The result might be related with environment. But, I am not sure why you output different result on the same computer.

    In my option, this property selects the version of the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocol to use for new connections that use the Secure Hypertext Transfer Protocol (HTTPS) scheme only, it is used for https, but VSTO is used for desktop Outlook.

    Did this behavior break down your application?

    If you want to opt out of the TLS feature, you may check below link to disable it.

    # Cannot connect to a server by using the ServicePointManager or SslStream APIs after upgrade to the .NET Framework 4.6

    https://support.microsoft.com/en-us/help/3069494/cannot-connect-to-a-server-by-using-the-servicepointmanager-or-sslstre

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 6, 2017 7:43 AM