So, what I've done:
Created a new Amazon EC2 instance, logged into.
sudo apt install curl
-> Installed curl without http2 support
run curl -sL swift.vapor.sh/ubuntu | bash
to install dependencies (I tried too with Swift 3.0.2)
Installed the toolbox curl -sL toolbox.vapor.sh | bash
Fine, vapor is running.
Then I cloned this sample project
https://github.com/4np/Example-APNS-Client-and-Server
Then I modified the Package.swift with VaporAPNS 1.2.0 to have the curl updater.
cd server
Created the apns.json to have key file and needed entries.
cd into server dir and run vapor clean
after that vapor build --run
Project builded correct, so I tried so send the notification App crash without any information. vapor run
is still dead.
curl --version
gives me
curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
without http2
I downloaded the .p8
from the Apple Dev Portal, maybe I have to modify read / write access?
I already tried with chmod ugo+wrx ~/certs/APNsAuthKey_M783BM8HLW.p8
and made sure the key exists.
let fileManager = FileManager.default
if fileManager.fileExists(atPath: APNSAuthKeyPath) {
log.debug("FILE AVAILABLE")
} else {
log.debug("FILE NOT AVAILABLE")
}
result
💚 DEBUG main.App():45 - FILE AVAILABLE
I tried few times before to build curl manually that worked, but crash was there too.
Anyone any ideas? I will give up soon :(