25

openssl 0.9.8 doesn't work with tls 1.2:

user@computer: /usr/bin/openssl version
OpenSSL 0.9.8zg 14 July 2015
user@computer: /usr/bin/openssl s_client -connect somesite.com:8443
CONNECTED(00000003)
write:errno=54

But openssl 1.0.2 are working with it:

user@computer: openssl version         
OpenSSL 1.0.2d 9 Jul 2015
user@computer: openssl s_client -connect somesite.com:8443
CONNECTED(00000003)
depth=2 C = US, O = "blah-blah" ...
....

I'm using MAMP as a local server. phpinfo: phpinfo

How change openssl version in MAMP? I know, that this question is duplicate, but I really need help.

Community
  • 1
  • 1
MichaelPak
  • 584
  • 1
  • 5
  • 16
  • I don't use mac, mamp and all those things but consider to stop using mamp if you need openssl 1.0 and they still deliver 0.9 even for current PHP version. For example PHP 5.5+ for Windows is delivered with openssl 1.0. I believe you can install PHP from another source or install development enviroment to virtual machine. As a PHP developer you should be able to install basic dev enviroment from the scratch. – kba Nov 25 '15 at 08:14
  • have you found a solution for that? if yes, could you please share it with me? I need to work with tls 1.2 too (because of ios 9)... – SagittariusA Dec 29 '15 at 21:09
  • @LoryLory, no, i haven't. – MichaelPak Dec 30 '15 at 13:37
  • 1
    ok...excuse me. What I can advise to you, if you don't already know it, is to use the latest version of AMPPS which has apache 2.4 and an upgraded version of openssl... see my post here: http://apple.stackexchange.com/questions/206901/using-mamp-3-4-how-do-i-upgrade-to-apache-2-4-and-openssl-1-0-2-to-meet-the-ats – SagittariusA Dec 30 '15 at 13:39
  • @LoryLory, oh! thank you! – MichaelPak Dec 30 '15 at 13:40

4 Answers4

13

I have asked this question to developers MAMP & MAMP PRO. Here's what they said:

MAMP (PRO) 3.x does NOT bundle OpenSSL software but uses what comes bundled with Mac OS. If you update OpenSSL in Mac OS, MAMP (PRO) should automatically use the updated version. We will be including the latest OpenSSL in our future MAMP 4 release, which will be available soon. This will be a paid update.


UPD From comments (thanks to @lukemh):

PHP CURL fails on Cloudflare or SSLv3 sites using MAMP 3.5 due to old OpenSSL version

Community
  • 1
  • 1
MichaelPak
  • 584
  • 1
  • 5
  • 16
  • 6
    these would be good news but I am afraid they're making fun of us because I updated OpenSLL on my MacBook Pro with El Capitan and following this answer (http://stackoverflow.com/questions/34518502/how-to-update-openssl-version-from-0-9-8zg-to-1-0-2e?noredirect=1#comment56800515_34518502) I updated also the links to new openssl binary file... (/usr/bin/openssl) but it did not work...both mamp and apache still use 0.9.8... :( – SagittariusA Dec 30 '15 at 13:56
  • would you tell me their email? I'd like to write them too – SagittariusA Dec 30 '15 at 14:00
  • @LoryLory, support@appsolute.zendesk.com – MichaelPak Dec 30 '15 at 14:01
  • @LoryLory, I had the same problem =( – MichaelPak Dec 30 '15 at 14:02
  • Ok, I'll write them asking hot to solve this problem and let you know ;) – SagittariusA Dec 30 '15 at 14:15
  • This is relevant: https://coreyolson.com/2016/02/14/php-curl-fails-on-cloudflare-or-sslv3-sites-using-mamp-3-5-due-to-old-openssl-version/ – lukemh Mar 18 '16 at 06:34
  • 5
    Just an warning about MAMP 4.0. I just instaled the pre-release 4 and it completely ereased all my websites under htdocs folder. Everything is gone. Thank goodness I made a backup. Be careful. – VVV Aug 12 '16 at 17:13
  • 3
    @vyx.ca no: they usually rename the old MAMP, they never delete. –  Mar 13 '17 at 13:32
5

I recompiled libcurl MAMP is using. It works for me now :)

So, let's do the following:

  1. Run /Applications/MAMP/Library/bin/curl-config --version to see which version you've got
  2. Go to http://curl.haxx.se/download/ and download the right version
  3. Configure it with ./configure --prefix=/Applications/MAMP/Library/
  4. make && make install

Source: http://dev.soup.io/post/56438473/If-youre-using-MAMP-and-doing-something

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Francisco Bueno
  • 165
  • 2
  • 6
  • @FranciscoBueno - this worked great at first but now I'm getting `Protocol "https" not supported or disabled in libcurl`. Apparently it should be configured with `--with-ssl` as well, but then it can't find the openssl files and configure fails. – Evan Mattson May 02 '16 at 16:14
  • Hi Fran, I needed to add --with-ssl=/usr/local/Cellar/openssl/1.0.2c to configure to use the homebrew installed version of openssl, otherwise it still uses the version provided by macos. – peterlozano May 26 '16 at 00:55
  • ``-bash: ./configure: No such file or directory`` – OZZIE Jun 28 '16 at 16:07
  • Okay, now I have "curl 7.49.1 (x86_64-apple-darwin15.5.0) libcurl/7.49.1 OpenSSL/1.0.2h zlib/1.2.5 librtmp/2.3" but still no TLS 1.2 in PHP - does file_get_contents e.g. uses libcurl internally? – Matthias Kleine Jul 05 '16 at 14:44
  • This worked for me. Here was an easy to follow guide: http://www.grasmash.com/article/using-httpsssl-mamps-curl-osx For MAMP you can drop that php.ini line into the php.ini for the PHP version you are running, i.e. Applications/MAMP/bin/php/php7.0.0/conf/php.ini – John F Nov 18 '16 at 17:47
4

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

sMyles
  • 2,418
  • 1
  • 30
  • 44
0

If you wish to continue using MAMP version 3 you could also do the following to get it to work:

  1. Rename your current version of MAMP to MAMPv3
  2. Download MAMP version 4 and once downloaded rename it to MAMPv4
  3. Rename MAMPv3 back to just plain old MAMP
  4. Go back into MAMPv4 and head into the "Library" directory and copy the folder inside called "OpenSSL"
  5. Move this folder into your older version of MAMP and reboot servers. Worked for me!