Changeset 34313 in project


Ignore:
Timestamp:
08/21/17 00:11:27 (3 months ago)
Author:
chust
Message:

[openssl] Enable client-side SNI by default in ssl-connect* except for IP addresses

Location:
release/4/openssl/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/openssl/trunk/openssl.scm

    r34304 r34313  
    4848   ##sys#check-string))
    4949
    50 (use srfi-13 srfi-18 tcp)
     50(use srfi-13 irregex srfi-18 tcp)
    5151
    5252(import
    53  (only srfi-13 string-join)
    5453 (only data-structures ->string)
    5554 (only files make-pathname))
    5655
    5756(require-library
    58  srfi-13 data-structures)
     57 data-structures)
    5958
    6059#>
     
    562561(define ssl-set-connect-state! (foreign-lambda void "SSL_set_connect_state" c-pointer))
    563562
     563(define ip-regex
     564  (sre->irregex
     565    '(or
     566       (seq (= 3 (** 1 3 digit) #\.) (** 1 3 digit))
     567       (seq (+ (* hex-digit) #\:) (+ hex-digit)))))
     568
    564569;; connect to SSL server
    565570(define (ssl-connect hostname #!optional port (ctx 'sslv2-or-v3) sni-name)
     
    573578      void
    574579      (lambda ()
     580        (when (eq? sni-name #t)
     581          (set! sni-name (and (not (irregex-match? ip-regex hostname)) hostname)))
    575582        (when sni-name
    576           (ssl-set-tlsext-hostname! ssl (if (string? sni-name) sni-name hostname)))
     583          (ssl-set-tlsext-hostname! ssl sni-name))
    577584        (ssl-set-connect-state! ssl)
    578585        (receive (tcp-in tcp-out)
     
    800807    ctx))
    801808
    802 (define (ssl-connect* #!rest args #!key hostname port sni-name)
     809(define (ssl-connect* #!rest args #!key hostname port (sni-name #t))
    803810  (ssl-connect hostname port (apply ssl-make-client-context* args) sni-name))
    804811
  • release/4/openssl/trunk/openssl.setup

    r34304 r34313  
    1919  'openssl
    2020  '("openssl.scm" "openssl.so" "openssl.import.so" "openssl-static.o")
    21   '((version "1.9.0")
     21  '((version "1.9.1")
    2222    (static "openssl-static.o")
    2323    (static-options "-lssl -lcrypto -lgdi32")))
Note: See TracChangeset for help on using the changeset viewer.