Requested security protocol is not supported - at System.Net.ServicePointManager.ValidateSecurityProtocol(SecurityProtocolType value)

Michael Brunner 40 Reputation points
2023-11-06T12:58:43.22+00:00

Hi,

I am working on a project where I am using a .NET library in native C++ via C++/Clr. I can execute the code and the dialog from the .NET library starts correctly (https://www.bimcollab.com/en/resources/developers/developer-sdk/).

User's image

But it seems that the security protocol that is being used is not supported. I have tried to analyze the error message and think that the problem is related to the security settings.

Can someone explain how I can fix this problem? Is there any way to update or customize the security logs to fix this error?

I would be very grateful for any help or advice you can give me. Many thanks in advance!

Exception:

Exception

The requested security protocol is not supported.
   at System.Net.ServicePointManager.ValidateSecurityProtocol(SecurityProtocolType value)
   at System.Net.ServicePointManager.set_SecurityProtocol(SecurityProtocolType value)
   at XLGnKXvXMGMh6CYEeEp.MDVV5rvEFtsd1GaX3pt.Iavn90tDwt9tSqVhI6C9(SecurityProtocolType)
   at XLGnKXvXMGMh6CYEeEp.MDVV5rvEFtsd1GaX3pt.l70vramEUL()
   at XLGnKXvXMGMh6CYEeEp.MDVV5rvEFtsd1GaX3pt.GuPgGhtkyADrIpqdOBMG()
   at XLGnKXvXMGMh6CYEeEp.MDVV5rvEFtsd1GaX3pt.xJNv0y6YDh()
   at BCF_Manager.DlgMain.TWAEUy3oeMWUsN4TCkQ()
   at BCF_Manager.DlgMain.Initialize()
   at BIMcollab_User_Control_Sample.Form1..ctor()
   at CLR.startDlg()


External Library:

Requirements 
The following requirements must be met to make use of the BIMcollab Connector:  

• The 3rd party application must be capable of integrating a UserControl built for .NET Framework 4.8 
• The 3rd party application must provide methods to retrieve and set camera settings, clipping planes as well as the visible and/or selected components 
• The 3rd party application must be able to run with the ‘Prefer 32-bit ’flag in the ‘Build – General settings ’switched off. 
• The Microsoft Visual C++ 2010 Redistributable Package must be added as a prerequisite for your application. 

My Setup:

.NET BimCollab library Framework 7.0

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net7.0-windows</TargetFramework>
    <Nullable>enable</Nullable>
    <UseWindowsForms>true</UseWindowsForms>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\AppInterface\AppInterface.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="BCFManagerControlLib">
      <HintPath>BCFManagerControlLib.dll</HintPath>
    </Reference>
  </ItemGroup>

</Project>

CLR / C++ Properties
User's image

C++ / CLR Code

CSHARP_API void CLR::startDlg() {
  try {
    auto lDlg = gcnew BIMcollab_User_Control_Sample::Form1();
    lDlg->Show();
  } catch (Exception ^ e) {
    auto lMsg = e->Message;
    Console::WriteLine(lMsg);
    Console::WriteLine(e->StackTrace->ToString());
  }
}


C++ native

bool plugin_x64_init(CwAPI3D::ControllerFactory* aFactory) {
  actory->getUtilityController()->printToConsole(lFormatted.data());
  CLR::startDlg();

  return false;
}

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,572 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
326 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,612 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 42,476 Reputation points
    2023-11-06T14:53:34.17+00:00

    The 3rd party application must be capable of integrating a UserControl built for .NET Framework 4.8

    The very first requirement speaks to .Net Framework 4.8. Have you tried targeting that instead of .Net 7?


1 additional answer

Sort by: Most helpful
  1. gekka 7,986 Reputation points MVP
    2023-11-06T15:30:27.2833333+00:00

    BCFManagerControlLib.dll seems library for .Net Framework 4.8.
    Therefore, NET 7.0 is probably not supported.

    ServicePointManager.SecurityProtocol in .Net Framework allowed SSL3, but it is not allowed in recently Net Core.

    I am guessing that BCFManagerControlLib.dll is trying to use SSL3 and is giving the error.

    You must create your app with .Net Framework 4.8, or request the library rebuild with NET 7.0 at the library publisher.

    0 comments No comments