On a newly installed FreeBSD 12 system, do the following: `pkg install expect tcllib tcltls` In a file `test.tcl`, copy the example code from https://www.tcl.tk/man/tcl8.6/TclCmd/http.htm#M49, which shows how to use https: ``` $ cat > test.tcl package require http package require tls ::http::register https 443 ::tls::socket set token [::http::geturl https://my.secure.site/] ``` Run the program: ``` $ expect test.tcl couldn't load file "/usr/local/lib/tls1.7.14/tcltls.so": /usr/local/lib/tls1.7.14/tcltls.so: Undefined symbol "get_dhParams" while executing "load [file join $dir tcltls.so] Tls" (lambda term "{dir} { if {{shared} eq "static"} { load {} Tls } els..." line 5) invoked from within "apply {{dir} { if {{shared} eq "static"} { load {} Tls } else { load [file join $dir tcltls.so] Tls } set tlsTclInitScript [file join $..." ("package ifneeded tls 1.7.14" script) invoked from within "package require tls" (file "test.tcl" line 2) $ ``` The expected behaviour is that this example program should not fail with this error. It should try to load the specified URL using HTTPS.
I have also tried installing /usr/ports/devel/tcltls. I get the same problem.
Possibly related: https://core.tcl.tk/tcltls/tktview?name=34cfe47490
A commit references this bug: Author: mi Date: Mon Dec 24 16:08:13 UTC 2018 New revision: 488274 URL: https://svnweb.freebsd.org/changeset/ports/488274 Log: Upgrade from 1.7.14 to 1.7.16. Might fix the PR: 234361 Changes: head/devel/tcltls/Makefile head/devel/tcltls/distinfo
I still seem to get the same error with the update: $ tclsh8.6 % package require tls couldn't load file "/usr/local/lib/tls1.7.16/tcltls.so": /usr/local/lib/tls1.7.16/tcltls.so: Undefined symbol "get_dhParams" % $ expect expect1.1> package require tls couldn't load file "/usr/local/lib/tls1.7.16/tcltls.so": /usr/local/lib/tls1.7.16/tcltls.so: Undefined symbol "get_dhParams" while executing "load [file join $dir tcltls.so] Tls" (lambda term "{dir} { if {{shared} eq "static"} { load {} Tls } els..." line 5) invoked from within "apply {{dir} { if {{shared} eq "static"} { load {} Tls } else { load [file join $dir tcltls.so] Tls } set tlsTclInitScript [file join $..." ("package ifneeded tls 1.7.16" script) invoked from within "package require tls" expect1.2>
FYI output of `make test` on the port: root@fb12:~ # cd /usr/ports/devel/tcltls/ root@fb12:/usr/ports/devel/tcltls # ls Makefile distinfo files pkg-descr work root@fb12:/usr/ports/devel/tcltls # make test ===> Testing for tcltls-1.7.16 /usr/local/bin/tclsh8.6 ./tests/all.tcl -load "lappend auto_path " Tests running in interp: /usr/local/bin/tclsh8.6 Tests running in working dir: /usr/ports/devel/tcltls/work/tcltls-1.7.16/tests Only running tests that match: * Skipping test files that match: l.*.test Only sourcing test files that match: *.test Tests began at Sun Dec 23 18:04:28 PST 2018 tlsIO.test couldn't load file "/usr/ports/devel/tcltls/work/tcltls-1.7.16/tcltls.so": /usr/ports/devel/tcltls/work/tcltls-1.7.16/tcltls.so: Undefined symbol "get_dhParams" Tests ended at Sun Dec 23 18:04:28 PST 2018 all.tcl: Total 0 Passed 0 Skipped 0 Failed 0 Sourced 0 Test Files.
I thought, I'd be able to reproduce this on FreeBSD-11 by installing security/openssl-devel . But that didn't work -- the port still compiled and tested nicely... If you can not research it yourself, it would have to wait for me to get a 12.0 system...
A commit references this bug: Author: mi Date: Mon Dec 31 01:13:49 UTC 2018 New revision: 488753 URL: https://svnweb.freebsd.org/changeset/ports/488753 Log: Newer OpenSSL versions have a slightly different function-signature coming out of "openssl dhparam -C". Be prepared for that -- while retaining compatibility with the older versions. PR: 234361 Reported by: Gerald Gutierrez Changes: head/devel/tcltls/files/patch-gen_dh_params
Ok, using security/openssl111 I was finally able to reproduce - and fix the problem on my 11.2 system. The port now builds and is usable, although one of the self-tests fails, when OpenSSL-1.1.1 is used. I submitted an upstream ticket about the self-test failure: https://core.tcl.tk/tcltls/tktview/3160b84294c87d84dc96daba09a736a88fd33c4c Please, let me know, whether "make tests" works for any differently for you. Thank you for your patience.
All good now!