Giter Club home page Giter Club logo

Comments (19)

manholo avatar manholo commented on May 18, 2024 1

#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.

biosafetylvl5 avatar biosafetylvl5 commented on May 18, 2024

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.

mghansen256 avatar mghansen256 commented on May 18, 2024

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.

sgrogan avatar sgrogan commented on May 18, 2024

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.

manholo avatar manholo commented on May 18, 2024

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.

yorikvanhavre avatar yorikvanhavre commented on May 18, 2024

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.

Cody-G avatar Cody-G commented on May 18, 2024

That code snippet works for me on windows. I didn't try the workaround though.

from freecad-addons.

simonvanderveldt avatar simonvanderveldt commented on May 18, 2024

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.

yorikvanhavre avatar yorikvanhavre commented on May 18, 2024

@simonvanderveldt I have no idea :)

from freecad-addons.

luzpaz avatar luzpaz commented on May 18, 2024

Is https://forum.freecadweb.org/viewtopic.php?f=3&t=22616 related to this issue?

from freecad-addons.

sgrogan avatar sgrogan commented on May 18, 2024

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.

yorikvanhavre avatar yorikvanhavre commented on May 18, 2024

I introduced the fix above in FreeCAD commit b604b27ad It doesn't seem to harm anyway.

from freecad-addons.

luzpaz avatar luzpaz commented on May 18, 2024

FreeCAD/FreeCAD@b604b27
FTFY

from freecad-addons.

luzpaz avatar luzpaz commented on May 18, 2024

Can someone test yorik's fix ?

from freecad-addons.

skaiser avatar skaiser commented on May 18, 2024

I tried Yorik's fix, and it worked on Mac OS Sierra.

from freecad-addons.

popper99 avatar popper99 commented on May 18, 2024

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.

elanlb avatar elanlb commented on May 18, 2024

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.

elanlb avatar elanlb commented on May 18, 2024

@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.

yorikvanhavre avatar yorikvanhavre commented on May 18, 2024

Yeah I think so too. Closing this then, thanks for reminding!

from freecad-addons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.