View Single Post
Old 12-18-2003, 10:56 AM  
neXus
Member
 
Join Date: Apr 2003
Posts: 47
Default [TCL] FTP Connection with SSL/TLS

hiho,

trying for hours .. but no success

PHP Code:
package require tls 1.4
package 
require ftp

set 
::ftp::VERBOSE 1
set 
::ftp::DEBUG   1

set ftp
(cntrl) [::ftp::Open $host $user $pass -port $prt -command[list ::tls::socket -require 1]] 
debug messages

PHP Code:
Starting new connection with:
  -
port xxxx
  
-command = ::tls::socket -require 1
C
Connection from xx.xx.xx.xx:xxxx
[16:50][*] + SSL-FTP connection established handle0
-> rc="220"
-> msgtext="welcome ...."
-> state="user"
---> USER neXus 
error msg :
Quote:
wrong # args: should be "tls::socket ?options? host port"
while executing
"::tls::socket -require 1 user"
("uplevel" body line 1)
invoked from within
"uplevel #0 $cb[list $msg] $args"
(procedure "Command" line 3)
invoked from within
"Command $ftp(Command) user"
("2" arm line 4)
invoked from within
"switch -exact -- $rc {
2 {
PutsCtrlSock $s "USER $ftp(User)"
set ftp(State) passwd
Comma..."
("user" arm line 2)
invoked from within
"switch -exact -- $ftp(State) {
user {
switch -exact -- $rc {
2 {
PutsCtrlSock $s "USER $ftp(U..."
(procedure "::ftp::StateHandler" line 69)
invoked from within
"::ftp::StateHandler 0 sock7"
after that i changed in ftp.tcl ( proc ::ftp::OpenControlConn {s {block 1}} { )

PHP Code:
set rc [catch {set ftp(CtrlSock) [socket $ftp(RemoteHost$ftp(Port)]} msg
to
PHP Code:
    set rc [catch {set ftp(CtrlSock) [::tls::socket $ftp(RemoteHost$ftp(Port)]} msg
that result in
PHP Code:
Starting new connection with:
  -
port xxxx
C
Connection from xx.xxx.xx.xx:xxx
SSL channel 
"sock7"errorunknown protocol
error reading 
"sock7"software caused connection abort
    
while executing
"gets $sock bufline"
    
(procedure "::ftp::StateHandler" line 16)
    
invoked from within
"::ftp::StateHandler 0 sock7" 
maybe any1 can help
neXus is offline