Debugging failing HTTPS WebRequest

后端 未结 3 933
南笙
南笙 2020-12-03 08:16

I\'m writing a small program which will make a GET request to a server using HTTPS and the HttpWebRequest class. The server (obviously) has a server certificate. It also exp

3条回答
  •  庸人自扰
    2020-12-03 08:57

    Slap some tracing on it! Traces are your best friend when debugging theese things. I once had one client which couldn't connect to our SSL-enabled service. Using tracing I found that someone had moved the system clock past our certificate expiry date. But I digress.

    Enable all applicable trace sources and see if something interesting show up in the logs.

    There's an old (2005) but excellent post by Durgaprasad Gorti that you should check out. It'll show you exactly what sources to add and in it he also shows some SSL traces using a custom validation callback.

    Example app.config from the very same blog post:

    
    
      
        
        
          
            
              
            
          
        
    
        
          
        
    
        
          
        
    
      
    
    

    Hopefully that'll provide you with some more data.

提交回复
热议问题