添加Python应用程序以接受传入的网络连接 [英] Add Python Application to accept incoming network connections

查看:38
本文介绍了添加Python应用程序以接受传入的网络连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行Django网络服务器时,我看到一个弹出窗口,其中显示-我总是点击允许"我可以在我的安全和防护"中看到"python"隐私设置在那里并设置为允许传入连接",但我仍然看到这个弹出窗口.如何防止此弹出窗口再次出现?

While running Django webserver, I get a popup window that says - I always click "Allow" and I can see in my Security & Privacy settings that "python" is there and is set to "Allow incoming connections," but I still get this popup. How can I prevent this popup from reappearing?

谢谢.

推荐答案

您可以通过自己对有问题的应用程序二进制文件进行签名来解决此问题.

You can resolve this by signing the offending application binary yourself.

Disclaimer: Signing an application yourself will make an application appear more
secure to the operating system, when in reality it isn’t. Only sign applications
that you are 100% sure are not spyware or otherwise malicious. If you have any
doubts, just uninstall/reinstall.

第1部分:创建签名身份

我要使用的解决方案–自己对应用程序进行签名–要求我创建一个签名身份(也称为签名证书).这很容易做到:

The solution I’m going for – signing the app myself – requires that I create a Signing Identity, also known as Signing Certificate. This is very easy to do:

  1. 打开应用程序>实用程序>钥匙串访问.
  2. 从钥匙串访问"菜单中,选择证书助手">创建证书".
  3. 填写证书名称.此名称作为证书名称出现在钥匙串访问"实用程序中.这也是您引用此证书时将使用的名称.我个人使用的名称是我的签名身份".
  4. 从证书类型"菜单中选择代码签名.
  5. 从类型"弹出菜单中选择自签名根".
  6. 选中让我覆盖默认设置"复选框.
  7. 点击继续.
  8. 指定证书的序列号.只要没有其他具有相同名称和序列号的证书,任何数字都可以使用.
  9. 点击继续.
  10. 填写证书信息.您可以使用真实或伪造的数据,我个人使用的是真实数据.
  11. 点击继续.
  12. 接受其余对话框的默认设置.

完成后,您将在钥匙串访问"中看到您的证书.验证您选择的名称,然后完成此步骤.干得好!

Once completed, you will see your certificate in Keychain Access. Verify the name you picked, and you’re done with this step. Well done!

第2步:(重新)对您的应用程序签名

现在,您必须签署您的申请.为此,请再次打开终端并使用以下命令:

Now you have to sign your application. To do this, open up Terminal again and use the following command:

codesign -s "My Signing Identity" -f $(which python)

将出现一个对话框,单击允许".

A dialog will appear, click "Allow".

现在再次启动您的应用程序.您将在上一次获得接受传入连接"对话框.点击允许".

Now start your application again. You will get the accept incoming connections dialog one last time. Click "Allow".

从现在开始,您将不再收到警告!现在,可以享受防火墙处于活动状态的安全性,而不必不停地单击允许".

From now on you should no longer get the warnings anymore! Now it is possible to enjoy the security of your firewall being active without the inconvenience of having to click "allow" constantly.

信用:作为此更新和带注释的解决方案指南的起点,其原始资源为 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆