mIRC Home    About    Download    Register    News    Help

Print Thread
SSL Sockets #64079 14/12/03 08:29 PM
Joined: Nov 2003
Posts: 33
AdmWiggin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2003
Posts: 33
Ok, i know you guys will probably tell me to search, but i did an All Forum search for SSL and only found topics about SSL irc server connections, so i will ask this :

can anyone tell me of a way to connect through SSL in either a socket, or a DLL, for something like the MSN Messenger protocoll SSL Login?

thanks in advance...
-Adm.Wiggin


--------------------
I may be insane, but I enjoy it!
Re: SSL Sockets #64080 15/12/03 10:23 AM
Joined: Oct 2003
Posts: 30
pleur Offline
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2003
Posts: 30
Yeah, you can use DLL's, but what i prevere is a COM, i'll give you my login, hope this helps for ya

Code:
alias loginSSL1 {
  If ($com(loginS)) {
    .comclose loginS
  }
  .comopen loginS WinHttp.WinHttpRequest.5.1
  If ($comerr) {
    echo - The COM cannot be opened: stop
    .comclose loginS
    return
  }
  If (!$com(loginS,Open,1,bstr,GET,bstr,https://nexus.passport.com/rdr/pprdr.asp)) {
    echo - Error: Page cannot be found
    .comclose loginS
    return
  }
  If (!$com(loginS,Send,1)) {
    echo - Error: Cannot send request
    .comclose loginS
    return
  }
  If ($com(loginS,GetResponseHeader,1,bstr,PassportURLs)) {
    If ($com(loginS).result) {
      tokenize 44 $ifmatch
      var %vPass = Passport1.4 OrgVerb=GET,OrgURL= $&
        $+ http%3A%2F%2Fmessenger%2Emsn%2Ecom, $&
        $+ sign-in= $+ $urlencode(%mPassPort) $+ , $&
        $+ pwd= $+ $decode(%mPassword) $+ , $&
        $+ lc= $+ %mTempLC $+ , $&
        $+ id= $+ %mTempID $+ , $&
        $+ tw= $+ %mTempTW $+ , $&
        $+ fs= $+ 2 $+ , $&
        $+ ru= $+ %mTempRU $+ , $&
        $+ ct= $+ %mTempCT $+ , $&
        $+ kpp= $+ %mTempKPP $+ , $&
        $+ kv= $+ %mTempKV $+ , $&
        $+ ver= $+ %mTempVER $+ , $&
        $+ tpf= $+ %mTempTPF
      If ($loginssl2($gettok($2,2,61),%vPass)) { }
    }
  }

  .comclose loginS
}

Alias loginSSL2 {
  If ($com(loginS2)) {
    .comclose loginS2
  }
  .comopen loginS2 WinHttp.WinHttpRequest.5.1
  If ($comerr) {
    echo - Error: COM cannot be opened
    .comclose loginS2
    return
  }
  If (!$com(loginS2,Open,1,bstr,GET,bstr,https://login.passport.com/login2.srf)) {
    echo - Error in requested page $1
    return
  }
  If (!$com(loginS2,SetRequestHeader,1,bstr,Authorization,bstr, $+ $2 $+ )) { return }
  If (!$com(loginS2,SetRequestHeader,1,bstr,Host,bstr,login.passport.com)) { return } 

  If (!$com(loginS2,Send,1)) {
    echo - Error: cannot send request
    .comclose loginS2
    return
  }
  If ($com(loginS2,GetResponseHeader,1,bstr,Location)) {
    eMSN Location: $com(loginS2).result
  }
  if ($com(loginS2,GetResponseHeader,1,bstr,Authentication-Info)) {
 
    var %var = $com(loginS2).result
    If ($gettok($gettok(%var,2,61),1,44) == success) {
      mSckSend sckMSNns eMSN USR $trialID TWN S $right($left($gettok($gettok(%var,6-,61),1,44),-1),-1)
    }

  }

  .comclose loginS2
}


(ECHO's quickly translated from dutch
the eMSN is a echo-ing function
the encode-function is to encode the adress to URL-encoding
)


------
Cheers m8!
Re: SSL Sockets #64081 15/12/03 03:08 PM
Joined: Dec 2003
Posts: 33
M
Man Offline
Ameglian cow
Offline
Ameglian cow
M
Joined: Dec 2003
Posts: 33
True that will work, but it is OS dependent, and you have to get winhttp.dll which M$ nolonger holds on their website.

By looking at your code I assume your using XP SP1, that code wont work with other OS's.

I suggest you use a dll for mIRC if you possibly can, it will ensure compatibility across all windows platforms.

I have a dll called ssl.dll, not too sure where to get it from though.

Re: SSL Sockets #64082 16/12/03 02:06 PM
Joined: Nov 2003
Posts: 33
AdmWiggin Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2003
Posts: 33
yes, i have that dll as well, but it is uncontrolled...

thanks for that code, i will try it out, and if it doesnt work, ill let you guys know grin

EDIT
i tried that code, and it is an XP only thing

WinHttp only works for XP frown

thanks for trying though!

Last edited by AdmWiggin; 16/12/03 02:13 PM.

--------------------
I may be insane, but I enjoy it!
Re: SSL Sockets #64083 16/12/03 05:47 PM
Joined: Oct 2003
Posts: 30
pleur Offline
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2003
Posts: 30
And what if you change the "WinHttp.WinHttpRequest.5.1" tot "WinHttp.WinHttpRequest.5", i guess that's the COM to use on not WinXP, but i could be wrong


------
Cheers m8!