Overview
Comment: | Added examples to doc |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c8af0f28b0ab24fd78fba42f87a9c0ad |
User & Date: | bohagan on 2024-02-10 22:55:46 |
Other Links: | manifest | tags |
Context
2024-02-11
| ||
02:16 | Corrected memory leaks in use of dynamic strings check-in: 6287936460 user: bohagan tags: trunk | |
2024-02-10
| ||
22:55 | Added examples to doc check-in: c8af0f28b0 user: bohagan tags: trunk | |
22:03 | Updated callback info in doc file check-in: a1c3e96ef5 user: bohagan tags: trunk | |
Changes
Modified doc/tls.html
from [6ba0c48ef9]
to [9f9597a4e4].
︙ | ︙ | |||
689 690 691 692 693 694 695 696 697 698 | <p> <em> The use of the variable <strong>tls::debug</strong> is not recommended. It may be removed from future releases. </em> </p> <br> Example #1: Use HTTP package | > > > > > > < < < | 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | <p> <em> The use of the variable <strong>tls::debug</strong> is not recommended. It may be removed from future releases. </em> </p> <h4><a name="DEBUG_EXAMPLES">Debug Examples</a></h4> <p>These examples use the default Unix platform SSL certificates. For standard installations, -cadir and -cafile should not be needed. If your certificates are in non-standard locations, update -cadir or use -cafile as needed.</p> <br> Example #1: Use HTTP package <pre><code> package require http package require tls set url "https://www.tcl.tk/" http::register https 443 [list ::tls::socket -autoservername true -require true -cadir /etc/ssl/certs \ |
︙ | ︙ | |||
748 749 750 751 752 753 754 | parray conn parray chan </code></pre> <h3><a name="HTTPS EXAMPLE">HTTPS EXAMPLE</a></h3> | | | > | > > | > > > > > > > > > > > > > > > > > > > | | > | 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 | parray conn parray chan </code></pre> <h3><a name="HTTPS EXAMPLE">HTTPS EXAMPLE</a></h3> <p>These examples use the default Unix platform SSL certificates. For standard installations, -cadir and -cafile should not be needed. If your certificates are in non-standard locations, update -cadir or use -cafile as needed.</p> Example #1: Get web page <pre><code> package require http package require tls set url "https://www.tcl.tk/" http::register https 443 [list ::tls::socket -autoservername true -require true -cadir /etc/ssl/certs] # Check for error set token [http::geturl $url] if {[http::status $token] ne "ok"} { puts [format "Error %s" [http::status $token]] } # Get web page set data [http::data $token] puts $data # Cleanup ::http::cleanup $token </code></pre> Example #2: Download file <pre><code> package require http package require tls set url "https://wiki.tcl-lang.org/sitemap.xml" set filename [file tail $url] http::register https 443 [list ::tls::socket -autoservername true -require true -cadir /etc/ssl/certs] # Get file set ch [open $filename wb] set token [::http::geturl $url -blocksize 65536 -channel $ch] # Cleanup close $ch ::http::cleanup $token </code></pre> <h3><a name="SPECIAL CONSIDERATIONS">SPECIAL CONSIDERATIONS</a></h3> <p>The capabilities of this package can vary enormously based upon how the linked to OpenSSL library was configured and built. New versions may obsolete older protocol versions, add or remove ciphers, change default values, etc. Use the <strong>tls::protocols</strong> commands to obtain the supported protocol versions.</p> <h3><a name="SEE ALSO">SEE ALSO</a></h3> <p><strong>socket</strong>, <strong>fileevent</strong>, <strong>http</strong>, <a href="http://www.openssl.org/"><strong>OpenSSL</strong></a></p> <hr> <pre> Copyright © 1999 Matt Newman. Copyright © 2004 Starfish Systems. Copyright © 2023 Brian O'Hagan. </pre> </body> </html> |