kapilt / getpaid

Automatically exported from code.google.com/p/getpaid
0 stars 0 forks source link

<urlopen error unknown url type: https> #230

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

Environment:  Zope 2.10.6-final, python 2.4.5, ubuntu linux (hardy server
edition), Plone-3.1.7 (Buildout) using the unified installer, and Apache2
redirects for VHM

GetPaid-0.7.1 installed via Buildout using "recipe =
getpaid.recipe.release"-- I have all the dependencies for getting GetPaid
to work.  Relevant portions of my buildout for GetPaid are provided at the
end of this post.

I installed OpenSSL and created server certificates.  GetPaid "works"
except for when inside the GetPaid "cart".  Here, clicking on the "Google
Checkout"
button returns the following error:

Exception Type URLError
Exception Value <urlopen error unknown url type: https> (For details, see
Traceback at the end of this post)

My research on the boards has suggested two resolutions to this error:

1) For https to work, your Python installation must support SSL. For this,
import _ssl must succeed. For that to work, OpenSSL must have been used
when Python was built.

2) If you get "urlopen error unknown url type: https" using buildout make
sure you have openssl and libssl-dev installed before you install python
(on ubuntu sudo apt-get install openssl libssl-dev)

The "fix" suggested for #1 is to described at
"http://paltman.com/2007/nov/15/getting-ssl-support-in-python-251/", which
basically explains how to:
a) install OpenSSL from source and config, make, make install
b) install Python from source make, make install so
c) edit the Modules/Setup.dist by un-commenting lines 206-209 (enables
Python to compile with OpenSSL).  See lines after suggested edit below:
   204:# Socket module helper for SSL support; you must comment out the other
   205:# socket line above, and possibly edit the SSL variable:
   206:SSL=/usr/local/ssl
   207:_ssl _ssl.c
   208:    -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl
   209:    -L$(SSL)/lib -lssl -lcrypto

d) config, make, make install (Python)

I think the "fix" suggested by #2 is to reinstall Zope/Plone after
installing openssl and libssl-dev.  However, in reviewing
"/opt/Plone-3.1/Python-2.4/lib/python2.4/config/Setup", I see that lines
206-209 are commented.  Based on fix #1, my fear for acting upon fix #2 is
going through the pain of reinstalling Plone after installing openssl and
libssl-dev only to find out that lines 206-209 should have been
un-commented in the Python that comes with the unified installer.

Question:  
What is the suggested approach to correcting error:  <urlopen error unknown
url type: https> ?

Any direction is appreciated.

Thanks... Jim

*** Buildout configuration relevant to GetPaid:

[buildout]
parts =
    getpaid
eggs =
    zc.ssl
[getpaid]
recipe = getpaid.recipe.release
addpackages=
    getpaid.paymentech
    getpaid.discount
    getpaid.googlecheckout

By default, "recipe = getpaid.recipe.release" installs the following
packages: ore.viewlet, getpaid.core, Products.PloneGetPaid, getpaid.wizard,
getpaid.nullpayment, five.intid, hurry.workflow, simplejson, yoma.batching,
zc.resourcelibrary and zc.table

*** ERROR TRACEBACK ***
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module getpaid.googlecheckout.browser.checkout, line 39, in __call__
  Module getpaid.googlecheckout.googlecheckout, line 93, in checkout
  Module getpaid.googlecheckout.controller, line 60, in send_xml
  Module gchecky.controller, line 405, in _send_xml
  Module urllib2, line 130, in urlopen
  Module urllib2, line 358, in open
  Module urllib2, line 381, in _open
  Module urllib2, line 337, in _call_chain
  Module urllib2, line 1053, in unknown_open
URLError: <urlopen error unknown url type: https>

Original issue reported on code.google.com by onsom...@gmail.com on 22 Dec 2008 at 7:19

GoogleCodeExporter commented 8 years ago
I'm beginning to think this is more of a url redirection issue than anything 
else.  I
made my whole site https (port 443) via apache. 

A reproduction of my issue follows:
1) go through the buying process to the point where you arrive at the cart with 
the
item you wish to buy, its price, and the quantity.
2) click on the Google Checkout button.

3) The url request (that's failing) is "https://mydomain.net/google-checkout"
4) which results in Error:  "<urlopen error unknown url type: https>"

I've encountered this error with every object type that I "make buyable".  

When I'm in the "cart", I can manually enter the url below and it will 
successfully
show the "Checkout" screen displaying a form collecting Contact Information, 
Mailing
Address, and Shipping Address.

'https://oct.dnsdojo.net/@@getpaid-checkout-wizard'

Any thoughts on why the requested url from the cart is
'https://mydomain.net/google-checkout' ?

What is the correct url that succeeds from the cart?

Thanks... Jim

Following is more detail from the error output:

AUTHENTICATED_USER  <PropertiedUser 'tony'>
URL 'https://mydomain.net/google-checkout'
VirtualRootPhysicalPath ('', 'Plone')
VIRTUAL_URL 'https://mydomain.net/google-checkout'
SERVER_URL  'https://mydomain.net'
LANGUAGE_TOOL   <Products.PloneLanguageTool.LanguageTool.LanguageBinding instance 
at
0xf4c3b90>
AUTHENTICATION_PATH 'Plone/virtual_hosting'
__ac    'NjE2NDZkNjk2ZTozZjYyNzI2Zjc3NmU2MzZmNjE3NDNm'
PUBLISHED   <Products.Five.metaclass.Checkout object at 0x1059bfd0>
ACTUAL_URL  'https://mydomain.net/google-checkout'
VIRTUAL_URL_PARTS   ('https://mydomain.net', 'google-checkout')
URL0    https://mydomain.net/google-checkout
URL1    https://mydomain.net
BASE0   https://mydomain.net
BASE1   https://mydomain.net
BASE2   https://mydomain.net/google-checkout
environ
HTTP_X_FORWARDED_SERVER 'mydomain.net/'
HTTP_REFERER    'https://mydomain.net/nucleus/bmw.jpg/@@getpaid-cart-add'
HTTP_ACCEPT_LANGUAGE    'en-us,en;q=0.5'
SERVER_SOFTWARE 'Zope/(Zope 2.10.6-final, python 2.4.5, linux2) ZServer/1.1 
Plone/3.1.7'
SCRIPT_NAME ''
REQUEST_METHOD  'POST'
PATH_INFO   '/VirtualHostBase/https/mydomain.net:443/Plone/VirtualHostRoot/google-
checkout'
SERVER_PROTOCOL 'HTTP/1.1'
channel.creation_time   1230308257
CONNECTION_TYPE 'Keep-Alive'
HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_USER_AGENT 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5)
Gecko/2008120122 Firefox/3.0.5'
HTTP_COOKIE '_ZopeId="44652467A3rUduu2Jbs";
__ac="NjE2NDZkNjk2ZTozZjYyNzI2Zjc3NmU2MzZmNjE3NDNm"'
SERVER_NAME '0.0.0.0'
REMOTE_ADDR '192.168.1.21'
HTTP_VIA    '1.1 mydomain.net/'
PATH_TRANSLATED
'/VirtualHostBase/https/mydomain.net:443/Plone/VirtualHostRoot/google-checkout'
SERVER_PORT '8080'
CONTENT_LENGTH  '57'
HTTP_HOST   'mydomain.net'
HTTP_ACCEPT 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
GATEWAY_INTERFACE   'CGI/1.1'
HTTP_X_FORWARDED_FOR    '192.168.1.1'
HTTP_X_FORWARDED_HOST   'mydomain.net'
CONTENT_TYPE    'application/x-www-form-urlencoded'
HTTP_ACCEPT_ENCODING    'gzip,deflate

Original comment by onsom...@gmail.com on 26 Dec 2008 at 4:39

GoogleCodeExporter commented 8 years ago
this is not a getpaid issue.

Original comment by lucielej...@gmail.com on 15 May 2009 at 8:50