Commit 5890a083 authored by Eric Timmons's avatar Eric Timmons
Browse files

Simplify openssl integration

simply reinit it on startup. The old library definition and funky *features*
stuff is no longer needed now that we're not using deploy any more
parent f5589d15
......@@ -5,60 +5,16 @@
(uiop:define-package #:clpm/http-client/cl-plus-ssl
(:use #:cl
(:import-from #:cffi)
(:import-from #:cl+ssl
(:export #:*openssl-available-p*))
(in-package #:clpm/http-client/cl-plus-ssl)
(cffi:define-foreign-library clpm-libcrypto-1
(:windows (:or #+(and windows x86-64) "libcrypto-1_1-x64.dll"
#+(and windows x86) "libcrypto-1_1.dll"
(:openbsd "")
(:darwin (:or "/opt/local/lib/libcrypto.dylib" ;; MacPorts
"/sw/lib/libcrypto.dylib" ;; Fink
"/usr/local/opt/openssl/lib/libcrypto.dylib" ;; Homebrew
"/usr/local/lib/libcrypto.dylib" ;; personalized install
"libcrypto.dylib" ;; default system libcrypto, which may have insufficient crypto
((and :unix (not :cygwin)) (:or ""
(:cygwin (:or "cygcrypto-1.1.dll" "cygcrypto-1.0.0.dll")))
(cffi:use-foreign-library clpm-libcrypto-1)
(defvar *openssl-available-p* t
"T if OpenSSL libraries are present and available in the image")
(defun maybe-load-openssl ()
(defun reinit-openssl ()
"Hook to be run on image restore that tries to load and initialize OpenSSL."
;; Errors could be from libraries not being available, or being unable to
;; initialize because an incompatible OpenSSL version was loaded.
;; Do not reload the libraries, deploy should have taken care of that already.
(let ((*features* (list* ::cl+ssl-foreign-libs-already-loaded *features*)))
(setf *openssl-available-p* t))))
(uiop:register-image-restore-hook 'maybe-load-openssl nil)
(uiop:register-image-restore-hook 'reinit-openssl nil)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment