If I import ssl directly in the main.py module I get the following error:

Traceback (most recent call last):
  File "C:\web2py\web2py.py", line 21, in <module>
    import gluon.widget
  File "C:\web2py\gluon\widget.py", line 26, in <module>
    from gluon import main, newcron
  File "C:\web2py\gluon\main.py", line 28, in <module>
    import ssl
  File "C:\Python27\lib\ssl.py", line 126, in <module>
    from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN
ImportError: cannot import name HAS_ALPN


sábado, 5 de Agosto de 2017 às 13:07:23 UTC+1, José Leite escreveu:
>
> Actual Rocket code:
> ------------------------------------------------------------
>
> # Import System Modules
> import sys
> import time
> import socket
> try:
>     import ssl
>     has_ssl = True
> except ImportError:
>     has_ssl = False
> # Import Package Modules
> # package imports removed in monolithic build
> # TODO - This part is still very experimental.
> # from .filelike import FileLikeSocket
>
> sábado, 5 de Agosto de 2017 às 13:06:07 UTC+1, José Leite escreveu:
>>
>> I did as you asked and in a shell did
>> import ssl
>> ssl.RAND_status() is 1L
>>
>>
>> sábado, 5 de Agosto de 2017 às 01:15:21 UTC+1, Dave S escreveu:
>>>
>>>
>>>
>>> On Friday, August 4, 2017 at 3:57:29 PM UTC-7, José Leite wrote:
>>>>
>>>> Admin console information:
>>>>
>>>> 2.15.2-stable+timestamp.2017.07.19.12.18.41
>>>> (A correr em Rocket 1.2.6, Python 2.7.13)
>>>>
>>>
>>> Just to be way too into verification, can you open a regular python 
>>> shell, and do "import ssl" and "ssl.RAND_status()" ?
>>>
>>> In the meantime, someone who actually knows something may be along
>>>
>>> /dps
>>>
>>>
>>>>
>>>> sexta-feira, 4 de Agosto de 2017 às 23:35:11 UTC+1, José Leite escreveu:
>>>>>
>>>>> Python 2.7.11 worked fine before the web2py upgrade. But I even tried 
>>>>> to update the version to the new 2.7.13 (all 32bit - the machine is 64).
>>>>>
>>>>> sexta-feira, 4 de Agosto de 2017 às 23:27:03 UTC+1, José Leite 
>>>>> escreveu:
>>>>>>
>>>>>> It doesn't print that information but the admin console says its 
>>>>>> Python 2.7.11 and after my upgrade 2.7.13
>>>>>>
>>>>>> sexta-feira, 4 de Agosto de 2017 às 22:57:53 UTC+1, Dave S escreveu:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Friday, August 4, 2017 at 2:48:19 PM UTC-7, José Leite wrote:
>>>>>>>>
>>>>>>>> Sorry I meant from source not .exe
>>>>>>>>
>>>>>>>>
>>>>>>> When you start web2py, it will print not only its own version but 
>>>>>>> the version of python it is using.  Can you confirm that information 
>>>>>>> here?
>>>>>>>
>>>>>>> /dps
>>>>>>>
>>>>>>>
>>>>>>>> sexta-feira, 4 de Agosto de 2017 às 22:47:07 UTC+1, José Leite 
>>>>>>>> escreveu:
>>>>>>>>>
>>>>>>>>> Yes I am running on a windows machine and run web2py from the .exe 
>>>>>>>>> file not from source.
>>>>>>>>>
>>>>>>>>> The command line is:
>>>>>>>>>
>>>>>>>>> C:\web2py\web2py.py -a admin -i 192.168.8.100 -p 443 -c server.crt 
>>>>>>>>> -k server.key -Y
>>>>>>>>>
>>>>>>>>> but it doesn't start the https version of the site and all 
>>>>>>>>> https://* calls to externeal services are not working either.
>>>>>>>>>
>>>>>>>>> No SSL from the moment I upgraded to web2py 2.15.2.
>>>>>>>>>
>>>>>>>>> sexta-feira, 4 de Agosto de 2017 às 22:20:24 UTC+1, Dave S 
>>>>>>>>> escreveu:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Friday, August 4, 2017 at 8:54:52 AM UTC-7, José Leite wrote:
>>>>>>>>>>>
>>>>>>>>>>> Well Leonel,
>>>>>>>>>>>
>>>>>>>>>>> before I upgraded to web2py 2.15.2 Python was working fine with 
>>>>>>>>>>> ssl even locally.
>>>>>>>>>>> I have python 2.7.11 exactly because I needed the newest ssl 
>>>>>>>>>>> protocols to work with PayPal.
>>>>>>>>>>> Strange...!?!?!?!!?
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> If there was any version information shown with that , you didn't 
>>>>>>>>>> paste it here.  My weak translation of the error message suggests 
>>>>>>>>>> you're 
>>>>>>>>>> running on a Windows machine; are you running the exe file or from 
>>>>>>>>>> source?  
>>>>>>>>>> (The exe uses it's own Python.  I would have expected it to have SSL 
>>>>>>>>>> support, but I don't test that currently, so can't vouch for it  
>>>>>>>>>> Windows is 
>>>>>>>>>> my home web2py development environment.)
>>>>>>>>>>
>>>>>>>>>> /dps
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> sexta-feira, 4 de Agosto de 2017 às 16:44:20 UTC+1, Leonel 
>>>>>>>>>>> Câmara escreveu:
>>>>>>>>>>>>
>>>>>>>>>>>> You are running a python version that was not compiled with ssl 
>>>>>>>>>>>> support. Since this is a development environment you could simply 
>>>>>>>>>>>> not 
>>>>>>>>>>>> demand https if the request is_local.  
>>>>>>>>>>>>
>>>>>>>>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to