Fiddler causing failure to establish/maintain SSL/TLS connection on HTTPS for Web Service call

2,995 views
Skip to first unread message

Jeremy Cowan

unread,
Jan 13, 2016, 4:33:04 PM1/13/16
to Fiddler
Hello,

I am trying to use Fiddler to view the data being transmitted on/during a web service call via SOAP to a .wsdl.  I have written a basic .NET 4.5 C# WindowsForm to send the request and accept the response.  However, when using Fiddler(v ) with the Tools->HTTPS->Capture HHTPS CONNECTs & Decrypt HTTPS Traffic enabled I receive an error in Visual Studios 2012 (see image 1 below and exception details also copied below).  When the Decrypt HTTPS Traffic is disabled I get an error message in Fiddler that I need to decrypt the data (image 2 below).  Any help or advice would be appreciated.

Thanks,
Jeremy

P.S. I also added my VS main code if it is helpful


Image 1: VS 2012 Error Message


EXCEPTION DETAILS:
System.Net.WebException was unhandled
  HResult=-2146233079
  Message=The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
  Source=System.Web.Services
  StackTrace:
       at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
       at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
       at Microsoft.Web.Services3.WebServicesClientProtocol.GetResponse(WebRequest request, IAsyncResult result)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at WindowsFormsApplication1.com.omnitracs.tm.qtmService.customerTrip(CustomerTripRequest customerTripRequest) in c:\Users\JeremyC\Documents\Visual Studio 2012\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Web References\com.omnitracs.tm\Reference.cs:line 80
       at WindowsFormsApplication1.Form1.bReqData_Click(Object sender, EventArgs e) in c:\Users\JeremyC\Documents\Visual Studio 2012\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Omnitracs.cs:line 64
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at WindowsFormsApplication1.Program.Main() in c:\Users\JeremyC\Documents\Visual Studio 2012\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 19
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Security.Authentication.AuthenticationException
       HResult=-2146233087
       Message=The remote certificate is invalid according to the validation procedure.
       Source=System
       StackTrace:
            at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
            at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
            at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
            at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
            at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
            at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
            at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
            at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
            at System.Net.ConnectStream.WriteHeaders(Boolean async)
       InnerException:


Image 2: Fiddler Error Message

Code:

Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3

EricLaw

unread,
Jan 14, 2016, 9:12:26 AM1/14/16
to Fiddler
This: " Could not establish trust relationship for the SSL/TLS secure channel." means that your system isn't configured to trust Fiddler's root certificate. When you enabled HTTPS decryption, did you accept the prompt asking whether you wanted to trust Fiddler's root certificate?

Inside Tools > Fiddler Options > HTTPS, click the Actions button and choose Trust Root Certificate.

Jeremy Cowan

unread,
Jan 14, 2016, 9:17:46 AM1/14/16
to Fiddler
Eric,

Just read your post from today on that issue at https://groups.google.com/forum/#!topic/httpfiddler/Jk1RWk4iWqY and it does fix the issue I am (now was having).  I really appreciate your quick response to my post! 

Jeremy Cowan

unread,
Jan 14, 2016, 9:24:06 AM1/14/16
to Fiddler
I think I should note for those who might need it in the future my steps:

Tools > Fiddler Options > HTTPS, click "Actions" button, click "Reset All Certificates"
Fiddler then prompts to create a trusted certificate, clicked yes
Click "Actions" button (again) click "Export Root Certificate to Desktop"
Click "OK" on Fiddler Options pop-up
On Desktop, double-click the FiddlerRoot.Cer
Click "Install Certificate", click "Next", chose Automoatic.... option, click "Next", click Finish

Eric Lawrence

unread,
Jan 14, 2016, 10:07:21 AM1/14/16
to Fiddler
None of the steps after "Click yes" to the Trust prompt are useful. When you choose to Trust Fiddler's root certificate, it functionally performs the same process (namely, inserting the CA certificate into the Windows Trust store).
Reply all
Reply to author
Forward
0 new messages