<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>THE .NET WAY &#187; HTTP</title>
	<atom:link href="http://www.thedotnetway.net/tag/http/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedotnetway.net</link>
	<description>El blog Tecnológico de Emilio Torrens y Jordi Cladera</description>
	<lastBuildDate>Thu, 29 Jul 2010 08:27:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Como saltarse los certificados al hacer conexiones HTTPS</title>
		<link>http://www.thedotnetway.net/2008/11/20/como-saltarse-los-certificados-al-hacer-conexiones-http/</link>
		<comments>http://www.thedotnetway.net/2008/11/20/como-saltarse-los-certificados-al-hacer-conexiones-http/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 08:43:00 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[HTTP]]></category>

		<guid isPermaLink="false">http://thedotnetway.wordpress.com/2008/11/20/como-saltarse-los-certificados-al-hacer-conexiones-http/</guid>
		<description><![CDATA[Si queremos hacer peticiones a un sitio https y no tenemos el certificado o no queremos usarlo la manera es la siguiente: 1- Crear una clase que implemente ICertificatePolicy donde la validación siempre devuelva true para pasársela al&#160; CertificatePolicy del ServicePointManager public class TrustAllCertificatePolicy :ICertificatePolicy { public TrustAllCertificatePolicy() { } #region ICertificatePolicy Members public bool [...]]]></description>
			<content:encoded><![CDATA[<p>Si queremos hacer peticiones a un sitio https y no tenemos el certificado o no queremos usarlo la manera es la siguiente:</p>
<p>1- Crear una clase que implemente ICertificatePolicy donde la validación siempre devuelva true para pasársela al&#160; CertificatePolicy del ServicePointManager </p>
<div class="wlWriterEditableSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:2be9b35a-10ea-427b-a9ee-403d5452efbe" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:#FFFFFF;white-space:pre-wrap;overflow:auto;font-family:Microsoft Sans Serif;font-size:11px;"><span style="color:#000000;"> </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">class</span><span style="color:#000000;"> TrustAllCertificatePolicy :ICertificatePolicy
    {
        </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> TrustAllCertificatePolicy()
        {
        }

        </span><span style="color:#0000FF;">#region</span><span style="color:#000000;"> ICertificatePolicy Members</span><span style="color:#000000;">

        </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">bool</span><span style="color:#000000;"> CheckValidationResult(ServicePoint sp,
                      X509Certificate cert,
                      WebRequest req,
                      </span><span style="color:#0000FF;">int</span><span style="color:#000000;"> problem)
        {
            </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> </span><span style="color:#0000FF;">true</span><span style="color:#000000;">;
        }

        </span><span style="color:#0000FF;">#endregion</span><span style="color:#000000;">
    }
</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>2-Pasarle la clase al ServicePointManager antes de hacer la petición</p>
<div class="wlWriterEditableSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:2e7ba089-7bd4-49c7-a991-c8f35bb6e5a3" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:#FFFFFF;white-space:pre-wrap;overflow:auto;font-family:Microsoft Sans Serif;font-size:11px;"><span style="color:#000000;">HttpWebRequest req </span><span style="color:#000000;">=</span><span style="color:#000000;"> (HttpWebRequest)WebRequest.Create(url);
ServicePointManager.CertificatePolicy </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> TrustAllCertificatePolicy();</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<div style="line-height:normal;"><span style="font-size:10pt;"></span></div>
<p>A partir de eso podemos hacer las peticiones sin el certificado.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2008/11/20/como-saltarse-los-certificados-al-hacer-conexiones-http/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test de compresi&#243;n HTTP</title>
		<link>http://www.thedotnetway.net/2007/10/24/test-de-compresion-http/</link>
		<comments>http://www.thedotnetway.net/2007/10/24/test-de-compresion-http/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 09:24:00 +0000</pubDate>
		<dc:creator>Emilio Torrens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Trucos]]></category>

		<guid isPermaLink="false">http://thedotnetway.wordpress.com/2007/10/24/test-de-compresion-http/</guid>
		<description><![CDATA[Activar compresión en IIS es relativamente sencillo, y extremadamente fácil en Apache. Una vez hecho, si queremos comprobar que todo ha ido bien y que beneficio obtenemos con el cambio podemos utilizar un servicio que nos ofrece port80 software. Ejemplo:]]></description>
			<content:encoded><![CDATA[<p>Activar compresión en IIS es relativamente <a href="http://www.thedotnetway.net/2007/05/11/ActivarCompresi%c3%b3nEnIIS60.aspx">sencillo</a>, y extremadamente fácil <a href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html">en Apache</a>. Una vez hecho, si queremos comprobar que todo ha ido bien y que beneficio obtenemos con el cambio podemos utilizar un <a href="http://www.port80software.com/products/httpzip/compresscheck">servicio</a> que nos ofrece <a href="http://www.port80software.com">port80 software</a>. </p>
<p><a href="http://www.port80software.com"><img src="http://www.thedotnetway.net/content/binary/port80.jpg" border="0" /></a></p>
<p>Ejemplo:</p>
<p> <img src="http://www.thedotnetway.net/content/binary/testGzipweb.jpg" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedotnetway.net/2007/10/24/test-de-compresion-http/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
