Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

reading https from TCL/tk

82 views
Skip to first unread message

Mark Tarver

unread,
Nov 13, 2017, 4:29:37 PM11/13/17
to
I''m working on an NLP project reading pages off the web and notice my TCL/tk reads http pages fine, but not https. This is a security feature of https?

Mark

Gerald Lester

unread,
Nov 13, 2017, 6:10:52 PM11/13/17
to
On 11/13/2017 03:29 PM, Mark Tarver wrote:
> I''m working on an NLP project reading pages off the web and notice my TCL/tk reads http pages fine, but not https. This is a security feature of https?

I can read pages fine over https with Tcl -- did you remember to
register the https handler?

Why don't you post a short example of not reading a page? It should be
under 10 lines of code.


--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

Rich

unread,
Nov 13, 2017, 6:18:55 PM11/13/17
to
Tcl's http accesses https pages just fine, provided you follow the
directions in the http man page:

https://www.tcl.tk/man/tcl8.6/TclCmd/http.htm

::http::register proto port command
This procedure allows one to provide custom HTTP transport types
such as HTTPS, by registering a prefix, the default port, and the
command to execute to create the Tcl channel. E.g.:

package require http
package require tls

::http::register https 443 ::tls::socket

set token [::http::geturl https://my.secure.site/]

You don't say if you did, or did not, follow these directions above, so
until you let us know if you've registered an https handler with the
http module, there is little more we can do here on Usenet to help.

Mark Tarver

unread,
Nov 13, 2017, 7:10:03 PM11/13/17
to
I used

package require http
set token [::http::geturl "https://en.wikipedia.org/wiki/Mil_Mi-24"]

Mark

Mark Tarver

unread,
Nov 13, 2017, 7:16:03 PM11/13/17
to
Thx; that enables me to fix the code.

Mark

Gerald Lester

unread,
Nov 13, 2017, 7:19:14 PM11/13/17
to
On 11/13/2017 06:10 PM, Mark Tarver wrote:
> On Monday, November 13, 2017 at 11:10:52 PM UTC, Gerald Lester wrote:
>> On 11/13/2017 03:29 PM, Mark Tarver wrote:
>>> I''m working on an NLP project reading pages off the web and notice my TCL/tk reads http pages fine, but not https. This is a security feature of https?
>>
>> I can read pages fine over https with Tcl -- did you remember to
>> register the https handler?
>>
>> Why don't you post a short example of not reading a page? It should be
>> under 10 lines of code.

Just to wrap up, in another part of this thread someone supplied the
missing registration:

> I used
>
> package require http
package require tls

::http::register https 443 ::tls::socket
> set token [::http::geturl "https://en.wikipedia.org/wiki/Mil_Mi-24"]

After which, the OP reports it now works.
0 new messages