Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annoying popup "accept incoming network connections" when using python and macosx. #8503

Closed
nikoltat opened this issue Jul 11, 2020 · 1 comment
Labels

Comments

@nikoltat
Copy link

🐛 Bug Report

When starting a driver (chrome or firefox, it doesn't matter), macosx firewall may issue a dialog asking
for a permission for incoming connections. The culprit is free_port() in common.service.utils
free_socket.bind(('0.0.0.0', 0)) should be either
free_socket.bind(('127.0.0.1', 0))
or
free_socket.bind(('localhost', 0))
Note that the obtained free port is used afterwards
with localhost, the ideal option should be free_socket.bind(('localhost', 0))

The dialogue closes itself almost immediately so a user has no chance to allow for 0.0.0.0 bindings.
One can go around the issue by assigning the port itself.

To Reproduce

One needs to make sure that we haven't given a permission to a firewall to allow to python bind to 0.0.0.0.

Then a simple python script will trigger the dialogue

from selenium import webdriver
driver = webdriver.Chrome(options=options)

Expected behavior

You should not use 0.0.0.0 when binding.

Environment

OSX, latest chromedriver (but it doesn't matter since this is triggered in common.utils), latest selenium

@ghost ghost added the needs-triaging label Jul 11, 2020
titusfortner pushed a commit to titusfortner/selenium that referenced this issue Aug 13, 2020
Since we no longer support PhantomJS we can get away from connecting
to 0.0.0.0 and rid ourselves of the annoying
popup on OSX.
@fschwahn
Copy link

I have the same problem when using the ruby driver in macOS. I searched the code for 0.0.0.0, and found:

def interfaces
interfaces = Socket.getaddrinfo('localhost', 8080).map { |e| e[3] }
interfaces += ['0.0.0.0', Platform.ip]
interfaces.compact.uniq
end

I replaced 0.0.0.0 with 127.0.0.1 locally, and it makes the popup go away.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants