[英]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.