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.