클라이언트에서 간헐적으로 https를 불러올 때 SSL 인증에러가 나는 것 같습니다.

C# .NET 6.0으로 작성된 윈폼 프로그램에서 외부 서버 URL을 가져와 json 정보를 불러올때
가끔씩 System.Reflection.TargetInvocationException: ‘Exception has been thrown by the target of an invocation.’ 에러가 발생합니다.
그래서 찾아본 결과 SSL 인증을 무시하게끔 설정하면 된다고 하여서 무시하게 설정을 해보았지만 여전히 오류는 간헐적으로 나타납니다.

아래는 정확한 오류 내용입니다.
System.Reflection.TargetInvocationException
HResult=0x80131604
메시지=Exception has been thrown by the target of an invocation.
소스=System.Private.CoreLib
StackTrace:
/ System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
/ System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 파일 //src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:줄 435
/ System.Delegate.DynamicInvokeImpl(Object[] args) 파일 /
/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs:줄 92
/ System.Delegate.DynamicInvoke(Object[] args) 파일 //src/libraries/System.Private.CoreLib/src/System/Delegate.cs:줄 61
/ System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) 파일 /
/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs:줄 6539
/ System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) 파일 //src/System.Windows.Forms/src/System/Windows/Forms/Control.cs:줄 6492
/ System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 파일 /
/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:줄 183
— 이전 위치의 스택 추적 끝 —
/ System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 파일 //src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:줄 207
/ System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 파일 /
/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:줄 148
/ System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) 파일 //src/System.Windows.Forms/src/System/Windows/Forms/Control.cs:줄 6475
/ System.Windows.Forms.Control.InvokeMarshaledCallbacks() 파일 /
/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs:줄 6571
/ System.Windows.Forms.Control.WndProc(Message& m) 파일 //src/System.Windows.Forms/src/System/Windows/Forms/Control.cs:줄 13357
/ System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 파일 /
/src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs:줄 68
/ System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 파일 //src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlNativeWindow.cs:줄 122
/ System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam) 파일 /
/src/System.Windows.Forms/src/System/Windows/Forms/NativeWindow.cs:줄 370
/ Interop.User32.DispatchMessageW(MSG& msg)
/ System.Windows.Forms.Application.ComponentManager.Interop.Mso.IMsoComponentManager.FPushMessageLoop(UIntPtr dwComponentID, msoloop uReason, Void* pvLoopData) 파일 //src/System.Windows.Forms/src/System/Windows/Forms/Application.ComponentManager.cs:줄 346
/ System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(msoloop reason, ApplicationContext context) 파일 /
/src/System.Windows.Forms/src/System/Windows/Forms/Application.ThreadContext.cs:줄 1117
/ System.Windows.Forms.Application.ThreadContext.RunMessageLoop(msoloop reason, ApplicationContext context) 파일 //src/System.Windows.Forms/src/System/Windows/Forms/Application.ThreadContext.cs:줄 981
/ System.Windows.Forms.Application.Run(Form mainForm) 파일 /
/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs:줄 1188
/ Modcraft.Program.Main() 파일 C:\Users\hancheol\Desktop\Modcraft\Modcraft\Program.cs:줄 69

내부 예외 1:
WebException: The SSL connection could not be established, see inner exception.

내부 예외 2:
HttpRequestException: The SSL connection could not be established, see inner exception.

내부 예외 3:
IOException: Unable to write data to the transport connection: 현재 연결은 원격 호스트에 의해 강제로 끊겼습니다…

내부 예외 4:
SocketException: 현재 연결은 원격 호스트에 의해 강제로 끊겼습니다.

*추가로 Control.cs, Delegate.cs, Delegate.CoreCLR.cs을 찾을 수 없다고 발생합니다.
해당 파일은 실제로 코드로 불러온 적도 없는데 해당 오류를 나타냅니다.

어떻게 해결하면 좋을까요?
고수님들의 답변을 기다리겠습니다… 감사합니다 꾸벅…

1개의 좋아요