Mobile/Cordova deployment with SSL?

Hi all,
Need to cash in some karma for some help. Anybody know how to deploy using --mobile-server and SSL?

cd myapp
modulus deploy
meteor run ios-device --mobile-server https://dev.myapp.com:443

I can deploy to iTunesConnect and TestFlight with a standard non-SSL deployment on either Modulus or meteor.com. I can access https://dev.myapp.com:443 via web. I can access the site with Cordova/Mobile with meteor run ios-device. But connecting to my SSL enabled server with Cordova eludes me.

Any secret syntax that I’m missing?

1 Like

May be you need to update modulus deploy tool. Hope it need to get updated for cordova.

You need to build the cordova app pointing to the SSL deployment. I use Modulus as well. Deploy as normal, then build the cordova app.

meteor build ~/cordova-builds/dev --server=https://dev.myapp.com 

Here’s the build step from my makefile you may find useful:

build:
rm -rf ~/cordova-builds/$(APP_ENV)
APP_ENV=$(APP_ENV) \
SUBDOMAIN=$(SUBDOMAIN) \
VERSION=$(VERSION) \
meteor build ~/cordova-builds/$(APP_ENV) --server=https://$(SUBDOMAIN).plusmoretablets.com 
cd ~/cordova-builds/$(APP_ENV)/android/
jarsigner -digestalg SHA1 ~/cordova-builds/$(APP_ENV)/android/unaligned.apk $(SUBDOMAIN)
~/.meteor/android_bundle/android-sdk/build-tools/20.0.0/zipalign 4 ~/cordova-builds/$(APP_ENV)/android/unaligned.apk ~/cordova-builds/$(APP_ENV)/android/$(SUBDOMAIN)-$(VERSION).apk

So it’s more building the cordova app pointing to the https url than deploying.

HI, just wondering if you resolved this? I am seeing the following in the XCode console:

2015-03-17 18:43:34.104 Buzzy[2365:1189155] NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

I did do the build with “–server https://” does it need to be “–server https://:443”?

I just found this:
errSSLHostNameMismatch -9843 The host name you connected with does not match any of the host names allowed by the certificate. This is commonly caused by an incorrect value for the kCFStreamSSLPeerName property within the dictionary associated with the stream’s kCFStreamPropertySSLSettings key. Available in OS X v10.4 and later.

Could it be that it thinks the host name is “https://meteor.local” ?

You’re awesome @patrickleet! Finally got done with a move to a new house, and am totally looking forward to giving your solution a try! Thank you thank you!

1 Like

@awatson1978 keen to hear if you have success. Can’t seem to get it working on my side. I am running with AWS Elastic Load Balancer out front. SSL works fine via a browser… it’s just the Cordova app that seems to be having heartburn with that “kCFStreamErrorDomainSSL, -9813” error.

@awatson1978 just wondering if you managed to get this to work. I am still getting an error on the XCode console of “2015-03-20 22:16:28.310 Buzzy[360:64213] NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)”

Hi! Haven’t gotten around to diving into this. The project I was working on has sort of fizzled, with the sponsor shifting deployment strategies. It’s on my list of things to implement for Symptomatic.io and Clinical Meteor apps, but I may be a few weeks/months away yet.

HI folks, I got this to work. The issue was as my error and was related to how to setup SSL certificates on AWS. I basically had to use the “optional” Certificate Chain from my SSL certificate provide. AWS support ended telling me which SSL chain from my provider… long story short it works now. BTW, one read herring is that SSL worked without this on Chrome. It worked sometimes on Safari and then always seemed to fail (ie untrusted) on Firefox. So it seems like Cordova was similar to Firefox.

1 Like

Hey folks, I was wondering would installing force-ssl package help with this issue? Thanks

Hi, @adamgins, I’m also getting the error you’ve mentioned (kCFStreamErrorDomainSSL, -9813). I’m running meteor in a EC2 linux instance hosted on AWS. Bought my certificate from RapidSSL, made a bundle with publick crt, intermediate crt, private key and deployed it with mup.

It all works fine on any desktop browser and on Android, but have this error on iOS.

Would you tell me exactly how you’ve bundled your ssl? Thanks

1 Like

You saved my bacon with this post. I don’t think i would have ever found this out in my own. Thanks again!!