mIRC Home    About    Download    Register    News    Help

Print Thread
socket script help #227395 08/11/10 08:27 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hello all,

I was wondering, if anyone could help me create just the basics of a socket script that creates an SSL connection to an IRC server.

I am quiet confident with sockets, but not sure where to start with SSL sockets.

I just need enough to simply create an SSL connection to a server, and will work out the rest on my own.

Any help would be greatly appreciated.



Newbie
Re: socket script help [Re: HaleyJ] #227397 08/11/10 08:44 PM
Joined: Jul 2006
Posts: 3,723
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,723
Originally Posted By: /help /sockopen
The -e switch creates an SSL connection
smile


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: socket script help [Re: HaleyJ] #227414 09/11/10 09:00 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Yeah, I'm pretty "confident" that the answer is in mIRC's help file under sockets. The default port for SSL socket is 443, compared to that of regular port 80:
Code:
sockopen -e $sockname www.YourWebsite.com 443
The rest is quite the same for scripting a non-SSL socket script.

Re: socket script help [Re: Tomao] #227415 09/11/10 10:04 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi there,

I have tried using the -e switch with no luck.

The socket does not even successfully open. I paste my code below.

Code:
alias test_ssl {
  if ($sock(test_ssl)) sockclose test_ssl
  sockopen -e test_ssl irc.hackthissite.org 7000
  echo 4 -s * /test_ssl: Opening ssl socket...
}
on *:sockopen:test_ssl: { echo 4 -s * /test_ssl: Socket $sockname now open }
on *:sockread:test_ssl: {
  var %tmpdata
  sockread %tmpdata
  tokenize 32 %tmpdata
  echo 4 -s * /test_ssl:  $1-
}


The script just echoes 'opening socket...'

Thanks in advance for any replies


Newbie
Re: socket script help [Re: HaleyJ] #227422 09/11/10 05:28 PM
Joined: Feb 2006
Posts: 181
C
Crinul Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
Quote:
mIRC supports secure server connections via SSL through the use of the OpenSSL libraries. mIRC loads the OpenSSL libraries automatically if they are available. The OpenSSL libraries are not distributed with mIRC, they must be downloaded separately.


//echo -sc info * SSL: $sslready

If $false, click here.


Re: socket script help [Re: HaleyJ] #227433 09/11/10 11:01 PM
Joined: Jul 2006
Posts: 3,723
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,723
Quote:
I have tried using the -e switch with no luck.
The socket does not even successfully open
When the on sockopen triggers, you have to check for $sockerr, which will be different from 0 if an error occured and in this case, you're not connected.
In your case, $sockerr is probably 0 and you're connected.
I'm not sure what you're expecting but after being connected you need to communicate with the server, here it's an irc server so you need to send the appropriate command such as NICK and USER .
Try :

Code:
alias test_ssl {
  if ($sock(test_ssl)) sockclose test_ssl
  sockopen -e test_ssl irc.hackthissite.org 7000
  echo 4 -s * /test_ssl: Opening ssl socket...
}
on *:sockopen:test_ssl:{
if ($sockerr) echo 4 -s * /test_ssl An error occured : $sock(test_ssl).wsmsg
else {
echo 4 -s * /test_ssl: Connected.
sockwrite -n test_ssl NICK :test_ssl 
sockwrite -n test_ssl USER test_ssl test_ssl test_ssl :test_ssl
 }
}
on *:sockread:test_ssl: {
  var %tmpdata
  sockread %tmpdata
  tokenize 32 %tmpdata
  echo 4 -s * /test_ssl: $1-
  ;here is a basic line so you'll respond to PING command with PONG in order to stay connected
if ($1 == PING) sockwrite -n test_ssl PONG $remove($2,:)
}


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: socket script help [Re: Crinul] #227454 10/11/10 11:53 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Thank You for all replies. It turns out my SSL dll files were non-existent.


Newbie