Comments (19)
#8 workaround, this seems to make it work in my mac, it possibly does the trick on other platforms too:
Modify addons_instaler.FCMacro, method run() of UpdateWorker, to use the default context. Instead of just
<<<
import ssl
self.progressbar_show.emit(True)
self.info_label.emit("Downloading addons list...")
u = urllib2.urlopen("https://github.com/FreeCAD/FreeCAD-addons")
===
import ssl
self.progressbar_show.emit(True)
self.info_label.emit("reading git addons repo...")
ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
u = urllib2.urlopen("https://github.com/FreeCAD/FreeCAD-addons", context=ctx)
>>>
The same should be done for all other instances of urllib2.urlopen(), or other hack to the effect.
from freecad-addons.
The macro should be able to download without python-git. But, since I cannot replicate your problem, it might be quickest for you to follow the instructions on this page to install python-git since the normal download method isn't working for you. (python-git isn't shipped with FreeCAD, and we use it as a optional option for downloading, but we do have a fallback normal download method. However, the normal method doesn't seem to be working for you, hence my recommendation.)
And, as a developer, I have one request for you. Could you enable your python console and report view (by going to View >> Panels >> Python console & Report view) and run the macro before you install python-git? It would be quite invaluable to have the logs so we can prevent others from running into the troubles you have encountered.
Please let us know if this helps you, and it would be great if you have the time to post the error log.
from freecad-addons.
This could be due to what is stated in issue number #8 : A problem with certificate validation.
On my system, I do not see any warnings in either the Python console or in the report view of FreeCAD.
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6704 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: 0c449d7e8f9b2b1fb93e3f8d1865e2f59d7ed253
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
My version of the FreeCAD add-ons macro is at this revision:
98e86af
from freecad-addons.
On Windows there is a packaging problem with the needed .dll's This should be fixed in the latest 0.17 development snapshots. I will be preparing updated 0.16 installers but that is not done yet.
from freecad-addons.
This is the error I get if I type in the console the url grabbing in the update worker from the add ons script:
import urllib2
u = urllib2.urlopen("https://github.com/FreeCAD/FreeCAD-addons")
Traceback (most recent call last):
File "", line 1, in
File "/Applications/FreeCAD.app/Contents/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/Applications/FreeCAD.app/Contents/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/Applications/FreeCAD.app/Contents/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/Applications/FreeCAD.app/Contents/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/Applications/FreeCAD.app/Contents/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/Applications/FreeCAD.app/Contents/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
So I infer issue #8 should be my problem (FreeCAD .16, OSX 10.11.6, python 2.7.11)
from freecad-addons.
This seems to work for me on linux... Any windows user who had the problem above could test if the following code snippet works without error? Just copy & paste into a python interpreter window...
import ssl, urllib2
ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
u = urllib2.urlopen("https://github.com/FreeCAD/FreeCAD-addons", context=ctx)
print(u.read())
from freecad-addons.
That code snippet works for me on windows. I didn't try the workaround though.
from freecad-addons.
Interesting. According to PEP-476 that introduced the change to enable cert validation by default the following should happen:
http.client can then replace its usage of ssl._create_stdlib_context with the ssl._create_default_https_context .
It seems like urllib2 actually doesn't create a default context at all :?
@yorikvanhavre Does your fix also work with the ssl.Purpose.SERVER_AUTH
purpose?
That's the default
from freecad-addons.
@simonvanderveldt I have no idea :)
from freecad-addons.
Is https://forum.freecadweb.org/viewtopic.php?f=3&t=22616 related to this issue?
from freecad-addons.
I don't think this is related https://forum.freecadweb.org/viewtopic.php?f=3&t=22616
The problem on windows was a packaging error on my part with ssl libs. It is fixed in 0.17.xxxx (Tell me if I'm wrong) and I thought also on 0.16.6707
On osx there is an unrelated ssl issue that from the forum is not because of FreeCAD, If necessary I can search for the posts.
On win this should be resolved. The python-git warning will persist because we do not bundle the python-git package, but the .zip fall back should work.
from freecad-addons.
I introduced the fix above in FreeCAD commit b604b27ad It doesn't seem to harm anyway.
from freecad-addons.
from freecad-addons.
Can someone test yorik's fix ?
from freecad-addons.
I tried Yorik's fix, and it worked on Mac OS Sierra.
from freecad-addons.
Newbie ! Trying to install workbenches. Have installed the Plugin Manager and in that window I press the "plugin loader" in the bottom left, but nothing happens and the window is not populated.
I tried Yorik`s fix. Did not change anything.
Please help!
from freecad-addons.
I got it working with @manholo's suggestion. @yorikvanhavre did add the fix to AddonManager.py but not addons_installer.FCMacro so I modified every occurrence of urlopen and added the context part. Right now it's in pull request #59 , but you can download the file and replace the old one in the macros folder. It worked for me, let me know if it works for you.
from freecad-addons.
@yorikvanhavre I think this issue can be closed. It seems to be working now that we use the default context with SSL. PR #60 expands on this by checking for the Python version (the previous Python 2 update didn't have this SSL certificate issue).
from freecad-addons.
Yeah I think so too. Closing this then, thanks for reminding!
from freecad-addons.
Related Issues (20)
- [New Addon/Workbench] FC Nodes HOT 3
- [Bug]Remove automatic py-slsv install for Assembly3 workbench HOT 5
- Proper way to set up a tabbed Preference page for a workbench ? HOT 4
- Make Rembench obsolete since it causes crash HOT 6
- Drawing dimesion workbench in latest version HOT 1
- [New Addon/Workbench] Taack PLM HOT 7
- NikraDAP HOT 3
- Deprecate ModernUI HOT 4
- Deprecate freecad-slic3r-tools HOT 1
- [Feature] Expose UI Color settings to advanced users via an Addon HOT 18
- [New Addon/Workbench] freecad-pyoptools HOT 1
- [New Addon] Better Tool Library HOT 1
- [FEATURE] List Addons by Popularity HOT 3
- [Bug] Many gitmodules are without .git extension, leading to them not showing up properly HOT 6
- [New Addon/Workbench] OSAFE HOT 1
- [Bug] Addon Manager fails to install addon HOT 6
- [Bug] `pip install --user` no longer supported in debian trixie HOT 3
- Prune unmaintained addons
- [New Addon/Workbench] OpenDark preference pack HOT 9
- [FEATURE] Create "Accesories" category
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freecad-addons.