M1 Mac exe SSL error

34 views
Skip to first unread message

Mike Engelhart

unread,
Oct 22, 2021, 5:25:10 PM10/22/21
to racket...@googlegroups.com
Hi all 

I'm new to Racket so this may be explained somewhere although searching the web I couldn't find anything related to this.

I'm working on my first real project in Racket and it leverages http-easy to do some simple API calls and processes the responses.   I wanted to build a binary to send to a colleague to test it (who isn't a programmer and doesn't have Racket installed) but when I build it on my intel Macbook Pro and then send it to my M1 iMac and try and run it I get this error:

ssl-make-client-context: requested protocol not supported;

 SSL not available; check `ssl-load-fail-reason'

  requested: 'auto

  context...:

   .../openssl/mzssl.rkt:672:0: encrypt->method

   .../openssl/mzssl.rkt:747:0: make-raw-context

   .../openssl/mzssl.rkt:736:0: make-context

   .../openssl/mzssl.rkt:764:0: ssl-make-client-context

   .../openssl/mzssl.rkt:1061:0: ssl-secure-client-context

   .../private/arrow-val-first.rkt:486:18

   .../private/session.rkt:40:0: make-session

   body of '#%embedded:net/http-easy:


My thought on building it with my Intel mac is that by doing that it would ensure that the M1 macs that my colleague also has it would use Rosetta 2 to run the code.   

So my question is, is there a way to build a universal binary for Mac OS or should I just build one on each platform and have separate binaries. 

Thanks for any help.

Mike

Matthew Flatt

unread,
Oct 22, 2021, 6:02:10 PM10/22/21
to Mike Engelhart, racket...@googlegroups.com
At Fri, 22 Oct 2021 17:24:30 -0400, Mike Engelhart wrote:
> I wanted to build a binary to send to a colleague to test it (who
> isn't a programmer and doesn't have Racket installed) but when I
> build it on my intel Macbook Pro and then send it to my M1 iMac

That should work.

I tried this small experiment:

;; ssl.rkt
#lang racket/base
(require openssl)

(define-values (i o) (ssl-connect "www.cs.utah.edu" 443))
'done

With that "ssl.rkt":

$ raco exe ssl.rkt
$ raco dist ssl-dist ssl
$ tar zcf ssl-dist.tgz ssl-dist

... copy ssl-dist.tgz to an M1,
then on that machine ...

$ tar zxf ssl-dist.tgz
$ ./ssl-dist/bin/ssl

and that much seemed to work.

Does the little "ssl.rkt" program above work for you? If not, which
version of Racket are you using? Also, just to make sure, are you
creating a distribution to move to the other machine, as opposed to
just an executable file?


Matthew

Mike Engelhart

unread,
Oct 22, 2021, 6:52:23 PM10/22/21
to Matthew Flatt, racket...@googlegroups.com
Hi Matthew

Thanks for the fast reply!   Well I have to apologize - I had skipped the "dist" step.  For some reason I assumed incorrectly the dist was if you were building for another OS vs hardware architecture.  I ran your test as well and it worked perfectly.  Thanks again!

Mike



Reply all
Reply to author
Forward
0 new messages