Description: Using Urlopen or urlretreive from urllib.request fails This could be related to this bug: #109241. Steps to Reproduce: 1. Get the spreadsheet file from #109241 2. Execute Actual Results: Error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)> Expected Results: No error Reproducible: Always User Profile Reset: No Additional Info: This has been a problem on Linux for some time. I think #109241 was classified as Windows only by mistake.
Created attachment 151055 [details] Example script to demo error The download macro reproduces the error.
I don't think this a LibreOffice problem but a request problem. Please check https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error Closing as RESOLVED NOTABUG. Put it back to UNCONFIRMED if you disagree
Hi Xisco, Thank you. Your effort is appreciated. But I disagree :-) For two reasons: A very similar problem on Windows was fixed some time ago. The article on Stackoverflow that you refer to is Python 2.7 and a completely different library (Urllib2). I will add Michael Stahl as he fixed #109241. @Michael: If you agree with Xisco I'll accept the case to be closed.
bug 109241 is about urllib not supporting https protocol at all, while if you get a CERTIFICATE_VERIFY_FAILED error it clearly does try to use https, so it's a different problem. the 2 most likely reason why you get a CERTIFICATE_VERIFY_FAILED error is that either the server certificate or one of its signing CA certificates is expired; or the server certificates's CA certificate chain doesn't have a trusted root in the bundled certificates that CPython uses, which i'd assume (but haven't checked) are the bundled certificates of LO's OpenSSL library. without knowing what the reason of the CERTIFICATE_VERIFY_FAILED error is, it's hard to tell of course... of course ideally urlib would use the operating system's CA store to verify stuff instead of whatever OpenSSL bundles, which would give the user a UI tool to add additional trusted CA certificates or remove default ones they don't trust - but i have no idea if that is possible.
All I can see is that a very simple urllib.request.urlretreive script works when using the normal Python interpreter but fails when using the built in interpreter that ships with LibreOffice.
(In reply to Leif Lodahl from comment #5) > All I can see is that a very simple urllib.request.urlretreive script works > when using the normal Python interpreter but fails when using the built in > interpreter that ships with LibreOffice. Hi Leif, Could you please attach a simple script that works in normal python and fails in LibreOffice ?
Created attachment 155211 [details] Example that fails in LibreOffice This script file can be placed in ~/.config/libreoffice/4/user/Scripts/python Run from Writer using Tools - Macros - Run macro -> My macros -> InsertImageTest -> download
Created attachment 155212 [details] This plain Python works Run with >> python3 InsertImageTestclean.py Look in the folder.
(In reply to Xisco Faulí from comment #6) Hi Xisco Thank you very much for your effort. I have attached two wimple scripts. Both scripts should be changed to download to an existing path on your computer. If you are not using Linux just replace with a path on your harddrive.
[Automated Action] NeedInfo-To-Unconfirmed
Created attachment 156336 [details] Generic Python module that works This is a generic Python module that works outside LibreOffice.
Created attachment 156337 [details] LibreOffice function that calls the generic function Here is the LibreOffice script that calls the generic Python module. (change the folder to append in line 3) In LibreOffice urllib fails.
I added two scripts to the bug. Ipsum.py is a Python module that returns a piece of text from the web with urlopen. TestAnything.py is a Python script for LibreOffice that calls the function in Ipsum.py and inserts the text in a Writer document. It fails!
(In reply to Leif Lodahl from comment #13) > I added two scripts to the bug. > Ipsum.py is a Python module that returns a piece of text from the web with > urlopen. > TestAnything.py is a Python script for LibreOffice that calls the function > in Ipsum.py and inserts the text in a Writer document. > > It fails! I get com.sun.star.uno.RuntimeException: Error during invoking function insertIpsum in module file:///home/user/libreoffice/instdir/share/Scripts/python/TestAnything.py (<class 'NameError'>: name 'paras' is not defined File "/home/tonttu/libreoffice/instdir/program/pythonscript.py", line 915, in invoke ret = self.func( *args ) File "/home/user/libreoffice/instdir/share/Scripts/python/TestAnything.py", line 12, in insertIpsum doc.getText().setString(Ipsum.getLoremipsum(1,paras,yes)) ) Please advise.
Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ? I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Dear Leif Lodahl, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping
Dear Leif Lodahl, Please read this message in its entirety before proceeding. Your bug report is being closed as INSUFFICIENTDATA due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of our bug tracker Warm Regards, QA Team MassPing-NeedInfo-FollowUp