diff --git a/letsencrypt/plugins/standalone/authenticator.py b/letsencrypt/plugins/standalone/authenticator.py index 7d5c3ea6e..d93a10008 100644 --- a/letsencrypt/plugins/standalone/authenticator.py +++ b/letsencrypt/plugins/standalone/authenticator.py @@ -378,7 +378,10 @@ class StandaloneAuthenticator(common.Plugin): results_if_failure.append(False) if not self.tasks: raise ValueError("nothing for .perform() to do") - if self.already_listening(challenges.DVSNI.PORT): + port = challenges.DVSNI.PORT + if self.config.test_mode: + port = 5001 + if self.already_listening(port): # If we know a process is already listening on this port, # tell the user, and don't even attempt to bind it. (This # test is Linux-specific and won't indicate that the port @@ -386,7 +389,7 @@ class StandaloneAuthenticator(common.Plugin): return results_if_failure # Try to do the authentication; note that this creates # the listener subprocess via os.fork() - if self.start_listener(challenges.DVSNI.PORT, key): + if self.start_listener(port, key): return results_if_success else: # TODO: This should probably raise a DVAuthError exception