Cant install android app using URL

I tried using app capability of appium with web URL and I am getting a different an untrusted certificate error in Appium logs.

Unhandled error: Error: CERT_UNTRUSTED
at SecurePair.<anonymous> (tls.js:1370:32)
at SecurePair.EventEmitter.emit (events.js:92:17)
at SecurePair.maybeInitFinished (tls.js:982:10)
at CleartextStream.read [as _read] (tls.js:469:13)
at CleartextStream.Readable.read (_stream_readable.js:320:10)
at EncryptedStream.write [as _write] (tls.js:366:25)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at EncryptedStream.Writable.write (_stream_writable.js:183:11)

When I use a different server I am getting this error.

Unhandled error: Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
at SecurePair.<anonymous> (tls.js:1370:32)
at SecurePair.EventEmitter.emit (events.js:92:17)
at SecurePair.maybeInitFinished (tls.js:982:10)
at CleartextStream.read [as _read] (tls.js:469:13)
at CleartextStream.Readable.read (_stream_readable.js:320:10)
at EncryptedStream.write [as _write] (tls.js:366:25)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at EncryptedStream.Writable.write (_stream_writable.js:183:11)
at write (_stream_readable.js:583:24) context: [POST /wd/hub/session/73f4ca7a-a99f-404c-b83b-a97e02e464e1/appium/device/install_app {"appPath":"https://myserver2.com/MyTestHelper.apk"}]

I have tried setting npm strict-ssl to false using the command below, but it still does not works:
npm config set strict-ssl false

Any suggestions?

Have you found a solution to this? I am having exactly the same issues. With one https server I am getting CERT_UNTRUSTED and the leaf signature one with another. I’ve been stuck on this for days now and none of the internet solutions are helpful…

Thanks!