on 03-31-2021 9:39 AM
Hello,
I am trying to POST a API request in my Automation under the activity Custom Script. But i am getting the error Hostname/IP does not match certificate's altnames: IP: **.**.***.*** is not in the cert's list:
i guess its related to SSL certificate, as same request posted perfectly on Postman.
I have tried to bypass/ignore it by sending an additional header in my request
insecure: true, but still facing same issues.
Any clues ?
Thanks
can you please try to add this to the options:
https: { rejectUnauthorized: false }
orrejectUnauthorized: false
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes i tried with
https: { rejectUnauthorized: false }
Still same SSL error , let me tell you that, the URL contain the local IP, which is accessible from the Local Machine where Desktop Agent is running.
Same Request working fine on Postman, AFTER DISABLING SSL CERTIFICATION VERIFICATION.
Is there any header to Bypass the SSL, like we can do it in C# .
Thanks Alot
So the final solution was to use both settings in the options ?
https:{ rejectUnauthorized: false },
cryptoCredentialsDetails: { minVersion: 'TLSv1' }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
we have done 2 things
Thanks
Taseeb Saeed
Dear thomas.jentsch,
Thanks for your answer, i have added https: { rejectUnauthorized: false }
and here is the error which i am facing now SSL routines:ssl_choose_client_version:unsupported protocol:c:\ws\deps\openssl\openssl\ssl\statem\statem_lib.c:1942:
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thomas.jentsch
Any Help ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have just tested HTTPS with my SAP BusinessObject server.
logon request
const options = {
resolveBodyOnly: true,
responseType: 'json',
url: pSession.accessURL + 'logon/long',
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'password': pSession.logonParameters.password,
'clientType': '',
'auth': pSession.logonParameters.authentication,
'userName': pSession.logonParameters.username
})
};
const response = await irpa_core.request.call(options);
pSession.logonToken = response.logonToken;
group request
const options = {
resolveBodyOnly: true,
responseType: 'json',
url: pSession.accessURL + '/v1/usergroups/usergroup',
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-SAP-LogonToken': pSession.logonToken
},
https: { rejectUnauthorized: false },
body : JSON.stringify({
'name': name
})
};
const response = await irpa_core.request.call(options);
found some information in google, searched for 'SSL routines:ssl_choose_client_version:unsupported protocol:c:\ws\deps\openssl\openssl\ssl\statem\statem_lib.c:1942' .
not sure this helps, but you may find more information here: The https.request() make error 'ERR_SSL_UNSUPPORTED_PROTOCOL' with Node V12.2.0
Dear Taseeb,
You may refer to the answer posted in Irpa-2.0-call-webservice
Hopefully this will help.
Thanks & Regards,
Deepty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear ,
I am using the same way, my script is as follows, but its still giving the same error
const options = {
resolveBodyOnly: true,
responseType: 'json',
url: pSession.accessURL,
method: 'POST',
insecure: true,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'api_password': pSession.logonParameters.password,
'api_username': pSession.logonParameters.username,
'key': pSession.logonParameters.key
})
};
const response = await irpa_core.request.call(options);
pSession.logonToken = response.access_token;
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.