Hex Artifact Content

Artifact 7dddaeb5babb188b9f629920fcef1c0d55d889947bdd7e00af3da9f6f9dfae5b:


0000: 09 57 69 6e 64 6f 77 73 20 44 4c 4c 20 42 75 69  .Windows DLL Bui
0010: 6c 64 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 20  ld instructions 
0020: 75 73 69 6e 67 20 6e 6d 61 6b 65 20 62 75 69 6c  using nmake buil
0030: 64 20 73 79 73 74 65 6d 0a 09 32 30 32 30 2d 31  d system..2020-1
0040: 30 2d 31 35 20 48 61 72 61 6c 64 2e 4f 65 68 6c  0-15 Harald.Oehl
0050: 6d 61 6e 6e 40 65 6c 6d 69 63 72 6f 6e 2e 64 65  mann@elmicron.de
0060: 0a 09 32 30 32 33 2d 30 38 2d 32 32 20 4b 65 76  ..2023-08-22 Kev
0070: 69 6e 20 57 61 6c 7a 65 72 20 28 6b 77 40 63 6f  in Walzer (kw@co
0080: 64 65 62 79 6b 65 76 69 6e 2e 63 6f 6d 29 0a 0a  debykevin.com)..
0090: 50 72 6f 70 65 72 74 69 65 73 3a 0a 2d 20 36 34  Properties:.- 64
00a0: 20 62 69 74 20 44 4c 4c 0a 2d 20 56 69 73 75 61   bit DLL.- Visua
00b0: 6c 53 74 75 64 69 6f 20 32 30 31 39 0a 2d 20 57  lStudio 2019.- W
00c0: 53 4c 20 0a 2d 20 4f 70 65 6e 53 53 4c 20 64 79  SL .- OpenSSL dy
00d0: 6e 61 6d 69 63 61 6c 6c 79 20 6c 69 6e 6b 65 64  namically linked
00e0: 20 74 6f 20 54 43 4c 54 4c 53 20 44 4c 4c 2e 20   to TCLTLS DLL. 
00f0: 57 65 20 75 73 65 64 20 61 20 66 72 65 65 6c 79  We used a freely
0100: 20 72 65 64 69 73 74 72 69 62 75 74 61 62 6c 65   redistributable
0110: 20 62 75 69 6c 64 20 6f 66 20 4f 70 65 6e 53 53   build of OpenSS
0120: 4c 20 66 72 6f 6d 20 68 74 74 70 73 3a 2f 2f 77  L from https://w
0130: 77 77 2e 66 69 72 65 64 61 65 6d 6f 6e 2e 63 6f  ww.firedaemon.co
0140: 6d 2f 66 69 72 65 64 61 65 6d 6f 6e 2d 6f 70 65  m/firedaemon-ope
0150: 6e 73 73 6c 2e 20 55 6e 7a 69 70 20 61 6e 64 20  nssl. Unzip and 
0160: 69 6e 73 74 61 6c 6c 20 4f 70 65 6e 53 53 4c 20  install OpenSSL 
0170: 69 6e 20 61 6e 20 61 63 63 65 73 73 69 62 6c 65  in an accessible
0180: 20 70 6c 61 63 65 20 28 77 65 20 75 73 65 64 20   place (we used 
0190: 74 68 65 20 6c 69 62 20 73 75 62 64 69 72 65 63  the lib subdirec
01a0: 74 6f 72 79 20 6f 66 20 6f 75 72 20 54 63 6c 20  tory of our Tcl 
01b0: 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 29 2e 0a 0a  installation)...
01c0: 31 2e 20 56 69 73 75 61 6c 20 53 74 75 64 69 6f  1. Visual Studio
01d0: 20 78 36 34 20 6e 61 74 69 76 65 20 70 72 6f 6d   x64 native prom
01e0: 70 74 2e 20 55 70 64 61 74 65 20 65 6e 76 69 72  pt. Update envir
01f0: 6f 6e 6d 65 6e 74 61 6c 20 76 61 72 69 61 62 6c  onmental variabl
0200: 65 73 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20  es for building 
0210: 54 63 6c 74 6c 73 2e 20 43 75 73 74 6f 6d 69 7a  Tcltls. Customiz
0220: 65 20 74 68 65 20 62 65 6c 6f 77 20 65 6e 74 72  e the below entr
0230: 69 65 73 20 66 6f 72 20 79 6f 75 72 20 73 65 74  ies for your set
0240: 75 70 2e 20 0a 0a 73 65 74 20 50 41 54 48 3d 25  up. ..set PATH=%
0250: 50 41 54 48 25 3b 43 3a 5c 74 63 6c 2d 74 72 75  PATH%;C:\tcl-tru
0260: 6e 6b 5c 6c 69 62 5c 6f 70 65 6e 73 73 6c 2d 33  nk\lib\openssl-3
0270: 5c 78 36 34 5c 62 69 6e 0a 73 65 74 20 49 4e 43  \x64\bin.set INC
0280: 4c 55 44 45 3d 25 49 4e 43 4c 55 44 45 25 3b 43  LUDE=%INCLUDE%;C
0290: 3a 5c 74 63 6c 2d 74 72 75 6e 6b 5c 74 63 6c 5c  :\tcl-trunk\tcl\
02a0: 6c 69 62 5c 6f 70 65 6e 73 73 6c 2d 33 5c 78 36  lib\openssl-3\x6
02b0: 34 5c 69 6e 63 6c 75 64 65 5c 6f 70 65 6e 73 73  4\include\openss
02c0: 6c 0a 73 65 74 20 4c 49 42 3d 25 4c 49 42 25 3b  l.set LIB=%LIB%;
02d0: 43 3a 5c 74 63 6c 2d 74 72 75 6e 6b 5c 74 63 6c  C:\tcl-trunk\tcl
02e0: 5c 6c 69 62 5c 6f 70 65 6e 73 73 6c 2d 33 5c 78  \lib\openssl-3\x
02f0: 36 34 5c 62 69 6e 0a 0a 0a 32 29 20 42 75 69 6c  64\bin...2) Buil
0300: 64 20 54 43 4c 54 4c 53 0a 0a 2d 3e 20 55 6e 7a  d TCLTLS..-> Unz
0310: 69 70 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20  ip distribution 
0320: 6f 6e 20 79 6f 75 72 20 73 79 73 74 65 6d 2e 20  on your system. 
0330: 0a 2d 3e 20 53 74 61 72 74 20 57 53 4c 2e 0a 2d  .-> Start WSL..-
0340: 3e 20 63 64 20 2f 6d 6e 74 2f 63 2f 70 61 74 68  > cd /mnt/c/path
0350: 2f 74 6f 2f 74 63 6c 74 6c 73 0a 0a 2e 2f 67 65  /to/tcltls.../ge
0360: 6e 5f 64 68 5f 70 61 72 61 6d 73 20 3e 20 64 68  n_dh_params > dh
0370: 5f 70 61 72 61 6d 73 2e 68 0a 0a 6f 64 20 2d 41  _params.h..od -A
0380: 20 6e 20 2d 76 20 2d 74 20 78 43 20 3c 20 27 74   n -v -t xC < 't
0390: 6c 73 2e 74 63 6c 27 20 3e 20 74 6c 73 2e 74 63  ls.tcl' > tls.tc
03a0: 6c 2e 68 2e 6e 65 77 2e 31 0a 73 65 64 20 27 73  l.h.new.1.sed 's
03b0: 40 5b 5e 30 2d 39 41 2d 46 61 2d 66 5d 40 40 67  @[^0-9A-Fa-f]@@g
03c0: 3b 73 40 2e 2e 40 30 78 26 2c 20 40 67 27 20 3c  ;s@..@0x&, @g' <
03d0: 20 74 6c 73 2e 74 63 6c 2e 68 2e 6e 65 77 2e 31   tls.tcl.h.new.1
03e0: 20 3e 20 74 6c 73 2e 74 63 6c 2e 68 0a 72 6d 20   > tls.tcl.h.rm 
03f0: 2d 66 20 74 6c 73 2e 74 63 6c 2e 68 2e 6e 65 77  -f tls.tcl.h.new
0400: 2e 31 0a 0a 2d 3e 20 56 69 73 75 61 6c 20 53 74  .1..-> Visual St
0410: 75 64 69 6f 20 78 36 34 20 6e 61 74 69 76 65 20  udio x64 native 
0420: 70 72 6f 6d 70 74 2e 0a 0a 63 64 20 43 3a 70 61  prompt...cd C:pa
0430: 74 68 5c 74 6f 5c 74 63 6c 74 6c 73 5c 77 69 6e  th\to\tcltls\win
0440: 0a 0a 52 75 6e 20 74 68 65 20 66 6f 6c 6c 6f 77  ..Run the follow
0450: 69 6e 67 20 63 6f 6d 6d 61 6e 64 73 20 28 6d 6f  ing commands (mo
0460: 64 69 66 79 20 74 68 65 20 66 6c 61 67 73 20 74  dify the flags t
0470: 6f 20 79 6f 75 72 20 73 70 65 63 69 66 69 63 20  o your specific 
0480: 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 73 29 2e 0a  installations)..
0490: 0a 6e 6d 61 6b 65 20 2d 66 20 6d 61 6b 65 66 69  .nmake -f makefi
04a0: 6c 65 2e 76 63 20 54 43 4c 44 49 52 3d 63 3a 5c  le.vc TCLDIR=c:\
04b0: 75 73 65 72 73 5c 77 6f 72 64 74 5c 74 63 6c 20  users\wordt\tcl 
04c0: 49 4e 53 54 41 4c 4c 44 49 52 3d 63 3a 5c 74 63  INSTALLDIR=c:\tc
04d0: 6c 2d 74 72 75 6e 6b 5c 74 63 6c 5c 6c 69 62 20  l-trunk\tcl\lib 
04e0: 53 53 4c 5f 49 4e 53 54 41 4c 4c 5f 46 4f 4c 44  SSL_INSTALL_FOLD
04f0: 45 52 3d 43 3a 5c 74 63 6c 2d 74 72 75 6e 6b 5c  ER=C:\tcl-trunk\
0500: 74 63 6c 5c 6c 69 62 5c 6f 70 65 6e 73 73 6c 2d  tcl\lib\openssl-
0510: 33 5c 78 36 34 0a 0a 6e 6d 61 6b 65 20 2d 66 20  3\x64..nmake -f 
0520: 6d 61 6b 65 66 69 6c 65 2e 76 63 20 54 43 4c 44  makefile.vc TCLD
0530: 49 52 3d 63 3a 5c 75 73 65 72 73 5c 77 6f 72 64  IR=c:\users\word
0540: 74 5c 74 63 6c 20 49 4e 53 54 41 4c 4c 44 49 52  t\tcl INSTALLDIR
0550: 3d 63 3a 5c 74 63 6c 2d 74 72 75 6e 6b 5c 74 63  =c:\tcl-trunk\tc
0560: 6c 5c 6c 69 62 20 53 53 4c 5f 49 4e 53 54 41 4c  l\lib SSL_INSTAL
0570: 4c 5f 46 4f 4c 44 45 52 3d 43 3a 5c 74 63 6c 2d  L_FOLDER=C:\tcl-
0580: 74 72 75 6e 6b 5c 74 63 6c 5c 6c 69 62 5c 6f 70  trunk\tcl\lib\op
0590: 65 6e 73 73 6c 2d 33 5c 78 36 34 20 69 6e 73 74  enssl-3\x64 inst
05a0: 61 6c 6c 0a 0a 54 68 65 20 72 65 73 75 6c 74 69  all..The resulti
05b0: 6e 67 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20  ng installation 
05c0: 77 69 6c 6c 20 69 6e 63 6c 75 64 65 20 62 6f 74  will include bot
05d0: 68 20 74 68 65 20 74 63 6c 74 6c 73 20 70 61 63  h the tcltls pac
05e0: 6b 61 67 65 20 61 6e 64 20 61 6c 73 6f 20 68 61  kage and also ha
05f0: 76 65 20 6c 69 62 63 72 79 70 74 6f 2e 64 6c 6c  ve libcrypto.dll
0600: 20 61 6e 64 20 6c 69 62 73 73 6c 2e 64 6c 6c 20   and libssl.dll 
0610: 63 6f 70 69 65 64 20 69 6e 74 6f 20 74 68 65 20  copied into the 
0620: 73 61 6d 65 20 64 69 72 65 63 74 6f 72 79 2e 20  same directory. 
0630: 0a 0a 33 29 20 54 65 73 74 0a 0a 53 74 61 72 74  ..3) Test..Start
0640: 20 74 63 6c 73 68 0a 0a 70 61 63 6b 61 67 65 20   tclsh..package 
0650: 72 65 71 75 69 72 65 20 74 6c 73 0a 70 61 63 6b  require tls.pack
0660: 61 67 65 20 72 65 71 75 69 72 65 20 68 74 74 70  age require http
0670: 0a 68 74 74 70 3a 3a 72 65 67 69 73 74 65 72 20  .http::register 
0680: 68 74 74 70 73 20 34 34 33 20 5b 6c 69 73 74 20  https 443 [list 
0690: 3a 3a 74 6c 73 3a 3a 73 6f 63 6b 65 74 20 2d 61  ::tls::socket -a
06a0: 75 74 6f 73 65 72 76 65 72 6e 61 6d 65 20 74 72  utoservername tr
06b0: 75 65 5d 0a 73 65 74 20 74 6f 6b 20 5b 68 74 74  ue].set tok [htt
06c0: 70 3a 3a 64 61 74 61 20 5b 68 74 74 70 3a 3a 67  p::data [http::g
06d0: 65 74 75 72 6c 20 68 74 74 70 73 3a 2f 2f 77 77  eturl https://ww
06e0: 77 2e 74 63 6c 2d 6c 61 6e 67 2e 6f 72 67 5d 5d  w.tcl-lang.org]]