简体   繁体   English

机器人框架请求找不到证书路径

[英]Robot Framework Requests could not find cert path

I am running the following keyword below to create a client cert session and it creates it perfectly fine:我在下面运行以下关键字来创建客户端证书 session 并且它创建它非常好:

Create Client Cert Session  alias=${alias}  url=${url}  client_certs=(${cert_path},${key_path})  verify=${False}

${cert_path} = /path/to/cert.pem

${key_path} = /path/to/key.pem

However, when I try to do a get request using the following keyword it gives me the following error:但是,当我尝试使用以下关键字执行获取请求时,会出现以下错误:

Get Request alias=${alias} uri=${Enrollment_URI}

Error:错误:

OSError: Could not find the TLS certificate file, invalid path: (

I printed out the path for the cert from the session object within the python requests library and it prints out like this:我从 python 请求库中的 session object 中打印出证书的路径,并打印如下:

('(', '/', 'p', 'a', 't', 'h', '/', 't', 'o', '/', 'c', 'e', 'r', 't', '.', 'p', 'e', 'm',')')

This is printed from the function that is sending the get request, not the session creation.这是从发送获取请求的 function 打印的,而不是 session 创建的。

From the error, it looks like the function in the get request is only reading the first ( in the path above and not recognizing it. I am not sure if there is something I should be doing to the path before I pass it into the keyword.从错误来看,get 请求中的 function 似乎只读取第一个(在上面的路径中并且没有识别它。我不确定在将路径传递给关键字之前是否应该对路径做些什么.

Robot is not python.机器人不是 python。 client_certs=(${cert_path},${key_path}) doesn't pass a tuple as the client_certs value. client_certs=(${cert_path},${key_path})没有将元组作为client_certs值传递。 It is passing a string that literally beings with a ( as the first character. That is why you get an error with invalid path '(' .它正在传递一个字符串,该字符串实际上以(作为第一个字符。这就是为什么您会收到invalid path '('的错误。

If you need to pass a list to Create client cert session , you have to create the list in a separate step:如果您需要将列表传递给Create client cert session ,则必须在单独的步骤中创建该列表:

@{client certs}=  create list  ${cert_path}  ${key_path}
Create Client Cert Session  alias=${alias}  url=${url}  client_certs=${client certs}  verify=${False}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何找到 SSL 证书文件的路径? - How to find the path to a SSL cert file? 错误:使用p证书符号时找不到域的CSR - Error: Could not find CSR for: domain when using puppet cert sign 无法找到请求目标的有效证书路径 - 签名证书 - unable to find valid certification path to requested target - signed cert SSL 证书问题与 Python 请求 - SSL cert issue with Python Requests 使用SSL证书触发器运行Tomcat服务器无法找到或加载主类cert.pkcs12 - Running Tomcat server with SSL certificate triggers could not find or load main class cert.pkcs12 需要帮助运行带有证书文件的 Spring restTemplate - 无法找到请求目标的有效证书路径 - Need help running Spring restTemplate with cert files - unable to find valid certification path to requested target 无法找到到所请求目标的有效证书路径 - 即使在导入证书后也会出错 - Unable to find valid certification path to requested target - error even after cert imported 请求:cert 和 verify 有什么区别? - Requests: what is the difference between cert and verify? 更改已注册的letsencrypt证书的webroot路径 - Change webroot-path of registered letsencrypt cert SSL CA证书(路径?访问权限?) - SSL CA cert (path? access rights?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM