Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make the Appium dotnet driver to trust the Appium server certificate? #455

Open
alvaro777 opened this issue Feb 23, 2021 · 6 comments

Comments

@alvaro777
Copy link

Hi there,
I am trying to use an SSL enabled Appium server, but when I try to open a session, I get this exception
Is there any way to instruct the client to trust the Appium server certificate? Similar to what the "Allow Unauthorized Certificates" option does in Appium Desktop:
image

I am using Appium web driver version 4.3.1.
Appium server 1.19.0

Thanks,
A

@Dor-bl
Copy link
Collaborator

Dor-bl commented Oct 27, 2022

I think this question should be placed under appium repo. @mykola-mokhnach / @KazuCocoa do we have such argument that we can pass to appium server?

@KazuCocoa
Copy link
Member

KazuCocoa commented Oct 27, 2022

It is dotnet client thing. I guess the endpoint has https with self-certificate, or something new certificate which is not valid for existing one. For example, Python 2's bundled certificates had the issue.

Then, a client should relax the validation like ignoring the validation. I haven't dug into the dotnet client's options to relax the validation, but it might have.

@Dor-bl
Copy link
Collaborator

Dor-bl commented Aug 9, 2024

@KazuCocoa, Trying to replicate this from my side.

I followed this guide: https://appium.io/docs/en/2.3/guides/tls/
and when I start the appium server with the cert and key I get HTTP: instead of HTTPS:

Here are the logs:

C:\Program Files\OpenSSL-Win64\crt>appium server --port 4724 --ssl-cert-path cert.pem --ssl-key-path key.pem
[Appium] Welcome to Appium v2.5.1
[Appium] Non-default server args:
[Appium] {
[Appium]   port: 4724
[Appium] }
[Appium] The autodetected Appium home path: C:\Users\Dor-B\.appium
[Appium] Attempting to load driver windows...
[Appium] Attempting to load driver uiautomator2...
[Appium] Attempting to load driver espresso...
[Appium] Requiring driver at C:\Users\Dor-B\.appium\node_modules\appium-windows-driver\build\index.js
[Appium] Requiring driver at C:\Users\Dor-B\.appium\node_modules\appium-espresso-driver\build\index.js
[Appium] Requiring driver at C:\Users\Dor-B\.appium\node_modules\appium-uiautomator2-driver\build\index.js
[Appium] WindowsDriver has been successfully loaded in 2.261s
[Appium] EspressoDriver has been successfully loaded in 2.261s
[Appium] AndroidUiautomator2Driver has been successfully loaded in 2.263s
[HTTP] Enabling TLS/SPDY on the server using the provided certificate
(node:14432) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
[Appium] Appium REST http interface listener started on http://0.0.0.0:4724
[Appium] You can provide the following URLs in your client code to connect to this server:
[Appium]        http://10.100.102.94:4724/
[Appium]        http://127.0.0.1:4724/ (only accessible from the same host)
[Appium] Available drivers:
[Appium]   - [email protected] (automationName 'Windows')
[Appium]   - [email protected] (automationName 'UiAutomator2')
[Appium]   - [email protected] (automationName 'Espresso')
[Appium] Available plugins:
[Appium]   - [email protected]
[Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate

@mykola-mokhnach
Copy link

@Dor-bl Please always try the most recent server version. The 2.5.1 one is pretty out of date

@Dor-bl
Copy link
Collaborator

Dor-bl commented Aug 10, 2024

@mykola-mokhnach Updated to 2.11.3, but still got the same outcome:

[Appium] Welcome to Appium v2.11.3
[Appium] The autodetected Appium home path: C:\Users\Dor-B\.appium
[Appium] Attempting to load driver windows...
[Appium] Attempting to load driver uiautomator2...
[Appium] Attempting to load driver espresso...
[Appium] Requiring driver at C:\Users\Dor-B\.appium\node_modules\appium-windows-driver\build\index.js
[Appium] Requiring driver at C:\Users\Dor-B\.appium\node_modules\appium-espresso-driver\build\index.js
[Appium] Requiring driver at C:\Users\Dor-B\.appium\node_modules\appium-uiautomator2-driver\build\index.js
[Appium] WindowsDriver has been successfully loaded in 13.159s
[Appium] EspressoDriver has been successfully loaded in 13.159s
[Appium] AndroidUiautomator2Driver has been successfully loaded in 13.162s
[HTTP] Enabling TLS/SPDY on the server using the provided certificate
(node:23024) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723
[Appium] You can provide the following URLs in your client code to connect to this server:
        http://10.100.102.94:4723/
        http://127.0.0.1:4723/ (only accessible from the same host)
[Appium] Available drivers:
[Appium]   - [email protected] (automationName 'Windows')
[Appium]   - [email protected] (automationName 'UiAutomator2')
[Appium]   - [email protected] (automationName 'Espresso')
[Appium] Available plugins:
[Appium]   - [email protected]
[Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate

@mykola-mokhnach
Copy link

I've checked it locally and it looks like there is a bug in logging. The server itself does start using a secure protocol though. appium/appium#20449 should fix the log line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants