2

I've just installed MAMP 3.4 on Yosemite but the Apache version inside is still 2.2. Is there a way to upgrade to Apache 2.4? Moreover I have installed through brew openssl 1.0.2 but MAMP Apache still starts with version OpenSSL/0.9.8zg. Why? I need this updates in order to meet new ATS iOS 9 requirements.

4
  • 1
    Interesting - I would have to wonder if this would be easier with a VM - using Vagrant or something to help instead of using MAMP altogether? Either way, I suggest you answer your own question by moving your edited-in solution to an answer. This will make it clearer for other users who are in search of a similar solution. Sep 22, 2015 at 19:00
  • Thank u for your comment. I'm afraid I don't know what Vagrant is but the idea of a VM maybe is quite good. Anyway remember that MAMP can't be used because actually it runs only apache 2.2 while apache 2.4.x is strictly required for TLS 1.2
    – Lory Lory
    Sep 22, 2015 at 19:04
  • Ah - I missed that all important note in your answer. Vagrant just helps you manage VMs. You would write some provisioning scripts which would build your machine with the tools that you would need, and then vagrant up to run all of them and boot the VM. Sep 22, 2015 at 20:16
  • I understand, thank you for your explanation. Unfortunately I know nothing about VMs and generally low level programming :(
    – Lory Lory
    Sep 22, 2015 at 20:18

2 Answers 2

1

As of July 21, 2016, there is a pre-release available of MAMP PRO 4 which includes OpenSSL 1.0.2, get the pre-release here:

https://www.mamp.info/en/pre-release.html

2
  • At last!! This is a very good piece of news! Thank you mate!
    – Lory Lory
    Jul 21, 2016 at 16:11
  • You're welcome, I was in the same position as you so had to share this info :)
    – sMyles
    Jul 21, 2016 at 17:49
4

For Mac OS X Yosemite

  1. Update openssl by brew to version >= 1.0.2d
  2. TLS 1.2 works only with apache 2.4 and actually MAMP is still given with apache 2.2. SOLUTION: download and install the latest version of AMPPS which runs a version of apache 2.4.x
  3. create a self signed certificate with sha256 (as requested by iOS 9) with

    openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout server.key -out server.crt

       and save server.key and server.crt into /Applications/AMPPS/apache/conf

  1. Be sure that ssl modules are loaded inside httpd.conf file of AMPPS
  2. Edit file /Applications/AMPPS/apache/conf/extra/httpd-ssl.conf adding:


<VirtualHost localhost:443>
   DocumentRoot "/Applications/AMPPS/www"
   ServerName localhost
   SSLEngine on
   SSLProtocol all -SSLv2 -SSLv3
   SSLHonorCipherOrder on
   SSLCertificateFile "/Applications/AMPPS/apache/conf/server.crt"
   SSLCertificateKeyFile "/Applications/AMPPS/apache/conf/server.key"
</VirtualHost>

inside

<IfModule ssl_module> ... </IfModule> 
  1. iOS 9 simulator will annoy you each time you use NSURLSession raising an error 9813 saying that the certificate is not valid (because is self signed). So in each class where you are going to use NSURLSession do, for example, the following:


class LoginService: NSObject, NSURLSessionDelegate {

func URLSession(session: NSURLSession,
    task: NSURLSessionTask,
    didReceiveChallenge challenge: NSURLAuthenticationChallenge,
    completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?)
    -> Void) {

    completionHandler(NSURLSessionAuthChallengeDisposition.UseCredential, NSURLCredential(forTrust: challenge.protectionSpace.serverTrust!))
}

...

func requestLoginWithURL (requestURL: NSURL, completionHandler: (success: Bool?) -> Void) {
    let configuration =
    NSURLSessionConfiguration.defaultSessionConfiguration()

    let urlRequest: NSURLRequest = NSURLRequest(URL: requestURL)

    let session = NSURLSession(configuration: configuration, delegate: self, delegateQueue:NSOperationQueue.mainQueue())

    /*
    dataTaskWithRequest: creates an HTTP request for the specified URL request object, and calls a handler upon completion.
    */
    let task = session.dataTaskWithRequest(urlRequest, completionHandler: { (data: NSData?, response: NSURLResponse?, error: NSError?) -> Void in

...
}

where the function URLSession is a delegate which will prevent the app from crashing because of the self signed certificate and it will accept anyway.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .