我正在尝试从我的MAC连接到安全的Azure Service Fabric群集,但我遇到了一些SSL问题
我可以通过网络浏览器通过相同的证书验证/资源管理器,但是当我尝试使用我的命令行时,我会收到SSl错误。 有什么建议吗?
Ushas-MacBook-Pro:azure-16 ushasm$ sfctl cluster select --endpoint https://mylinuxx.centralindia.cloudapp.azure.com:19080 --pem client.pem

错误:
请求中出错。,SSLError: HTTPSConnectionPool(主机=' mylinuxx.centralindia.cloudapp.azure.com&#39 ;, port = 19080):使用url超出了最大重试次数:/(由...引起) SSLError(SSLError(1,' [SSL:CERTIFICATE_VERIFY_FAILED]证书 验证失败(_ssl.c:777)'),))回溯(最近一次呼叫最后):
文件 " /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py" ;, 第601行,在urlopen中 chunked = chunked)文件" /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", 第346行,在_make_request中 self._validate_conn(conn)File" /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", 第850行,在_validate_conn中 conn.connect()File" /usr/local/lib/python3.6/site-packages/urllib3/connection.py" ;, line 326,在连接中 ssl_context = context)文件" /usr/local/lib/python3.6/site-packages/urllib3/util/ssl_.py" ;, line 329,在ssl_wrap_socket中 return context.wrap_socket(sock,server_hostname = server_hostname)文件 " /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py" ;, 第407行,在wrap_socket中 _context = self,_session = session)File" /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", 第814行,在 init 中 self.do_handshake()File" /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", 第1068行,在do_handshake中 self._sslobj.do_handshake()File" /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", 第689行,在do_handshake中 self._sslobj.do_handshake()ssl.SSLError:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:777)在处理上述异常期间,发生了另一个异常:
Traceback(最近一次调用最后一次):文件 " /usr/local/lib/python3.6/site-packages/requests/adapters.py" ;, line 440,发送 timeout = timeout文件" /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", 第668行,在urlopen ** response_kw)文件" /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", 第668行,在urlopen ** response_kw)文件" /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", 第668行,在urlopen ** response_kw)文件" /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", 第639行,在urlopen _stacktrace = sys.exc_info()[2])文件" /usr/local/lib/python3.6/site-packages/urllib3/util/retry.py" ;, line 388,增量 引发MaxRetryError(_pool,url,error或ResponseError(cause))urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(主机=' mylinuxx.centralindia.cloudapp.azure.com&#39 ;, port = 19080):使用url超出了最大重试次数:/(由...引起) SSLError(SSLError(1,' [SSL:CERTIFICATE_VERIFY_FAILED]证书 验证失败(_ssl.c:777)'),))
在处理上述异常期间,发生了另一个异常:
Traceback(最近一次调用最后一次):文件 " /usr/local/lib/python3.6/site-packages/msrest/service_client.py" ;, 第201行,发送 ** kwargs)文件" /usr/local/lib/python3.6/site-packages/requests/sessions.py" ;, line 508,请求中 resp = self.send(prep,** send_kwargs)File" /usr/local/lib/python3.6/site-packages/requests/sessions.py" ;, line 618,发送 r = adapter.send(request,** kwargs)File" /usr/local/lib/python3.6/site-packages/requests/adapters.py" ;, line 506,发送 提出SSLError(e,request = request)requests.exceptions.SSLError:HTTPSConnectionPool(host =' mylinuxx.centralindia.cloudapp.azure.com', port = 19080):使用url超出了最大重试次数:/(由...引起) SSLError(SSLError(1,' [SSL:CERTIFICATE_VERIFY_FAILED]证书 验证失败(_ssl.c:777)'),))
在处理上述异常期间,发生了另一个异常:
Traceback(最近一次调用最后一次):文件 " /usr/local/lib/python3.6/site-packages/knack/cli.py" ;,第125行,在 调用 cmd_result = self.invocation.execute(args)File" /usr/local/lib/python3.6/site-packages/knack/invocation.py" ;,第85行, 执行中 cmd_result = parsed_args.func(params)File" /usr/local/lib/python3.6/site-packages/knack/commands.py" ;,第67行, 在通话 return self.handler(* args,** kwargs)File" /usr/local/lib/python3.6/site-packages/knack/commands.py" ;,第123行, 在_command_handler中 result = op(client,** command_args)if client else op(** command_args)File " /usr/local/lib/python3.6/site-packages/sfctl/custom_cluster.py" ;, line 95,在选择中 rest_client.send(rest_client.get(' /'))。raise_for_status()File" /usr/local/lib/python3.6/site-packages/msrest/service_client.py" ;, 第227行,发送 raise_with_traceback(ClientRequestError,msg,err)File" /usr/local/lib/python3.6/site-packages/msrest/exceptions.py" ;, line 45,在raise_with_traceback中 提出error.with_traceback(exc_traceback)文件" /usr/local/lib/python3.6/site-packages/msrest/service_client.py", 第201行,发送 ** kwargs)文件" /usr/local/lib/python3.6/site-packages/requests/sessions.py" ;, line 508,请求中 resp = self.send(prep,** send_kwargs)File" /usr/local/lib/python3.6/site-packages/requests/sessions.py" ;, line 618,发送 r = adapter.send(request,** kwargs)File" /usr/local/lib/python3.6/site-packages/requests/adapters.py" ;, line 506,发送 引发SSLError(e,request = request)msrest.exceptions.ClientRequestError:请求中发生错误。, SSLError: HTTPSConnectionPool(主机=' mylinuxx.centralindia.cloudapp.azure.com&#39 ;, port = 19080):使用url超出了最大重试次数:/(由...引起) SSLError(SSLError(1,' [SSL:CERTIFICATE_VERIFY_FAILED]证书 验证失败(_ssl.c:777)'),))
答案 0 :(得分:0)
您使用的是自签名证书吗?如果是,请将--no-verify
添加到sfctl cluster select
命令。
如果是未签名的自签名证书,则可以通过 --no-verify选项绕过CA验证如果是 没有CA签名的自签名证书,可以通过 --no-verify选项以绕过CA验证