APNS Handshake Failure from Scala - scala

I'm trying to send a push notification to apple device (iphone) using Scala, and Notnoop APNS, but when i ran this code:
import com.notnoop.apns._
val service = APNS.newService().withCert("certfile.p12", "passphrase").withAppleDestination(true).build()
service.start()
val payload = APNS.newPayload().alertBody("nomnomnom").sound("default")
service.push("deviceToken", payload.build())
service.stop()
i always stuck on this, ssl handshake error:
Thread-20, handling exception: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
based on this question, i may have invalid certificate, but I'm sure this certificate works, because using this PHP sample, i can send a push notification correctly.
Any idea where's my process gone wrong?

Related

Unable to disable SSL verification in IOS

I have an app in Swift 4 which is making a POST request to this domain :
qa-api-session.apps.com
Where I get a JWT as a response.
While the call works perfectly fine in Postman and curl, it does not work in IOS and I receive this message :
nw_protocol_boringssl_handshake_negotiate_proceed(724) [0x7fa6d4f0bac0] handshake failed at state 0
2019-09-30 12:30:18.861722-0300 app[4492:188024] Connection 1: received failure notification
2019-09-30 12:30:18.861847-0300 app[4492:188024] Connection 1: failed to connect 1:61, reason -1
2019-09-30 12:30:18.861967-0300 app4492:188024] Connection 1: encountered error(1:61)
2019-09-30 12:30:18.865759-0300 app4492:188024] Task <XXXX>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
I am searching for a way of DISABLING SSL verification and I cant find a straight forward manner. Supposedly I could include some keys on my info.plist but its not working at all.
I just want to make the request and make sure everything is working. Certificate pinning will be done later on.
How can I achieve this?

fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fatal alert: handshake_failure

I am trying to connect to a REST service using certificates as it is a HTTPS call. I am getting the following error in while my service is trying to call the REST service :
[kafaka_test].http.requester.HTTPS_Request_Configuration.worker(2), WRITE: TLSv1.2 Handshake, length = 40
[kafaka_test].http.requester.HTTPS_Request_Configuration.worker(3), READ: TLSv1.2 Alert, length = 2
[kafaka_test].http.requester.HTTPS_Request_Configuration.worker(3), RECV TLSv1.2 ALERT: fatal, handshake_failure
[kafaka_test].http.requester.HTTPS_Request_Configuration.worker(3), fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fat
al alert: handshake_failure
[kafaka_test].http.requester.HTTPS_Request_Configuration.worker(3), fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fat
al alert: handshake_failure
Can anyone help with the cause and resolution of this? Thanks in advance

Fiddler 2 error: SecureClientPipeDirect failed: System.IO.IOException Unable to read data from the transport connection

I am trying to decrypt the https traffic by fiddler2 which has just been upgraded.
What is the problem to get this errror?
17:27:45:6821 !SecureClientPipeDirect failed: System.IO.IOException Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. < A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond on pipe to (CN=192.168.0.100, O=DO_NOT_TRUST, OU=Created by http://www.fiddler2.com)
Thanks
The error message indicates that the client failed to complete the HTTPS handshake. What was the client? This message typically indicates that the client isn't configured to trust Fiddler's Root Certificate.
What, if any, other messages are shown on the Log tab?

NSURLRequest HTTPS problems - iphone

I am creating an NSURLMutableRequest and setting HTTP methods and content-types and such. All was working fine until my last compile. I now get this in the Console, but the app doesn't crash:
CODE:
Internal error.
Exception from other package:
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
and then the program continues. Code can be posted if you need it. The URL I am contacting is:
https://apps.quickbooks.com/j/AppGateway
This is VERISIGN not some Joe Blow make-your-own SSL cert.
Thanks guys!
Should have researched. QBOE XML processor is down.

How do I enable more handshake ciphers in CFStream?

When running the method:
CFReadStreamSetProperty(theReadStream, kCFStreamPropertySSLSettings (CFDictionaryRef)tlsPacket->tlsSettings);
To secure the connection of a CFReadStream, my iphone client returns the error:
Error Domain=kCFStreamErrorDomainSSL Code=-9824 "Operation could not be completed. (kCFStreamErrorDomainSSL error -9824.)"
and the server sends the error:
ERROR [STDERR] javax.net.ssl.SSLHandshakeException: no cipher suites in common
Is there any way to allow CFReadStream to use additional ciphers during the handshake process?
For anyone else who runs into this problem:
It turns out that the problem was on the server side. If you run into this issue yourself I would urge you to check that the handshake on the server side is working properly.