c# - Fiddler and .Net 3.5 SSL error. Works fine in .Net 4.0 -


first thing, site , post.

https://saplic.receita.pb.gov.br/sintegra/sinf_consultasintegra.jsp fullfil field cnpj value instance 34151100004209.

works fine in chrome , .net 4.0 httpwebrequest. cant debug in fiddler , cant make work on .net 3.5

i'm using

system.net.servicepointmanager.servercertificatevalidationcallback += new system.net.security.remotecertificatevalidationcallback(customxertificatevalidation); system.net.servicepointmanager.securityprotocol = system.net.securityprotocoltype.ssl3; system.net.servicepointmanager.expect100continue = false; 

this driving me insane. appreciated make things more clear, i'm having 1 problem happening on 2 differente places (fiddler , .net 3.5)

the code i'm trying run is.

    cookiecontainer cookcon =  new cookiecontainer();     httpwebrequest request = (httpwebrequest)webrequest.create("http://sintegra.receita.pb.gov.br/sintegra/sintegra.asp?estado=pb");     request.timeout = configuration.timeout;     request.proxy = configuration.proxy;     request.useragent = "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/34.0.1847.116 safari/537.36";     request.headers.add("accept-encoding", "gzip, deflate");     request.cookiecontainer = new cookiecontainer();     using (httpwebresponse response = request.getresponse() httpwebresponse)     {         foreach (cookie c in response.cookies)         {             cookcon.add(c);         }         response.close();     }      httpwebrequest request = (httpwebrequest)webrequest.create("https://saplic.receita.pb.gov.br/sintegra/");     request.referer = "http://sintegra.receita.pb.gov.br/sintegra/sintegra.asp?estado=pb";     request.headers.add("x-devtools-emulate-network-conditions-client-id", "c5e5561b-11f5-4d9e-a9d4-54a18e660d11");     request.cookiecontainer = cookcon;     request.accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";     request.useragent = "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/37.0.2062.103 safari/537.36";      string html = "";      string encoding = "iso-8859-1";     request.timeout = 20000;      request.headers.add("accept-encoding", "gzip, deflate");     using (httpwebresponse response = request.getresponse() httpwebresponse)     {         stream s = response.getresponsestream();         if (response.contentencoding.tolower().contains("gzip"))         {             s = new gzipstream(s, compressionmode.decompress);             using (system.io.streamreader resstream = new streamreader(s, system.text.encoding.getencoding(encoding)))             {                 html = resstream.readtoend();                 resstream.close();             }         }         else if (response.contentencoding.tolower().contains("deflate"))         {             s = new deflatestream(s, compressionmode.decompress);             using (system.io.streamreader resstream = new streamreader(s, system.text.encoding.getencoding(encoding)))             {                 html = resstream.readtoend();                 resstream.close();             }         }         else         {             using (system.io.streamreader resstream = new streamreader(response.getresponsestream(), system.text.encoding.getencoding(encoding)))             {                 html = resstream.readtoend();                 resstream.close();             }         }         s.close();         s.dispose();         response.close();     } 

the error i'm getting "unexpeted eof" excpetion when try make post(getresponse part of code above). if try surf site on chrome fiddler on, wont return northing, keeps on hold, hold, hold , nothing.

if copy same code new 4.0 project, runs without problem. if not clear, please post doubts, i'm trying clear possible.

since no 1 helped, made webservice using .net 4.0 framework , i'm calling 3.5 app.

still no clue why happens..


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -