MacOSX:Do you want the application “Python.app” to accept incoming network connections?
With the OS X firewall enabled, you can remove the "Do you want the application “Python.app” to accept incoming network connections?" message.
Solution 1
You can simply select "Allow All" in your firewall, or simply turn it off.
Settings —> Security & Privacy —> Firewall —> Off
Solution 2
Create a self-signed certificate.
- Open Keychain Access. Applications > Utilities > Keychain Access.
- Keychain Access menu > Certificate Assistant > Create a Certificate...
- Enter a Name like "Python-App-Cert".
- Select Identity Type: Self Signed Root
- Select Certificate Type: Code Signing
- Check the Let me override defaults box
- Click Continue,Enter a unique Serial Number,such as 1
- Enter 7300 for Validity Period. (gives you 20 years 365*20)
- Click Continue for the rest of the dialogs
- Email, Name, etc. fill out as you wish. xxx@mimvp.com; Python-App-Cert; mimvp.com; ceo; beijing; beijing; CN
- Key pair info: set to RSA, 2048 bits. Does not really matter IMHO.
- From "Key Usage Extension" up to "Subject Alternate Name Extension": accept the defaults.
- Location: login keychain.
- Once it is created, set to "Always trust" in the Login keychain: right-click on the certificate, choose "Get Info",
- in the "Trust" section, set "When using this certificate" to "Always trust".
Now sign your application
sudo
codesign -s <certname> -f --deep /path/to/application.
app
sudo codesign -s "Python-App-Cert" -f /Library/Frameworks/Python.framework/Versions/2.7/bin/python
sudo codesign --force --deep --sign - /Library/Frameworks/Python.framework/Versions/2.7/bin/python
If that doesn't help, try without --deep
and without the trailing slash:
sudo codesign --force --sign - /Library/Frameworks/Python.framework/Versions/2.7/bin/python
Note that when using a virtual environment,
you need to activate the virtual environment before running this command.
In the dialog that appears, click "Allow".
版权所有: 本文系米扑博客原创、转载、摘录,或修订后发表,最后更新于 2018-01-16 22:59:46
侵权处理: 本个人博客,不盈利,若侵犯了您的作品权,请联系博主删除,莫恶意,索钱财,感谢!
转载注明: MacOSX:Do you want the application “Python.app” to accept incoming network connections? (米扑博客)