Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


February 2006

Do It Yourself with SelfSSL

A quick way to put a certificate on your Web server
RSS
Subscribe to Windows IT Pro | See More Internet Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

I recently set up a new system to replace my Web and email server. Eventually, I'll get around to moving the old system's Secure Sockets Layer (SSL) server certificate to the new system, but the old system—an e-commerce system—will need that certificate for a few months to handle secure transactions. Therein lies a problem: How do I get a new SSL server certificate for the new system?

I'm not about to give VeriSign $349 just to acquire an SSL certificate that I'll need for only a few months. But if I want to access my new email server's Web mail feature from the road, SSL is a must. So how can I get a temporary certificate? I've set up Windows-based certificate servers in the past, but setting up a certificate server to generate one certificate is a time-consuming pain. Resigned to wasting an hour or two, I reached for the server CDs—and then I remembered something. I'd just installed the Microsoft Internet Information Services (IIS) 6.0 Resource Kit, and one of its tools had something to do with SSL. A quick check with the resource kit revealed a command-line tool called SelfSSL, and it turned out to be just what I needed.

A Little Background
Apparently, someone at Microsoft had the same need that I did: a way to create a simple self-signing SSL certificate and automatically install it on a Web server. If you're wondering what good a self-signed SSL certificate does, recall that SSL is supposed to accomplish two things: First, it lets you carry on an encrypted conversation over the Internet between your Web browser and a Web server, and second, it lets you verify that you're talking to a particular Web server. Of course, self-signed SSL certificates don't accomplish that second goal, but that's not a problem in this case. I just want email functionality without the danger of someone sniffing passwords. Again, it's just a short-term solution.

Making It Work
You run SelfSSL on the server that you want the certificate on. The tool takes several options, but I used three— /t, /v, and /n—as follows:

selfssl /t /v:200 /n:cn=web2.minasi.com 

The /n option—the most important—lets you tell Self-SSL what to put in the certificate. In my case, I simply needed a certificate for a server named web2.minasi.com verifying that this server is indeed called "web2 .minasi.com." To do that, as you can see, I add

cn=<server-DNS-name> 

after the /n option.

But what if I'm running more than one Web site on a given Web server? Or, what if I have just one Web site, but its name isn't web2.minasi.com—even though it's sitting on a system named web2.minasi.com? Either of these scenarios will generate a browser error message. To work around these potential problems, I can add the /s (for site) option. IIS identifies its sites internally with a number; simply type that site number after the /s option, and the certificate will match the site's name rather than the server's name.

The /t option saves you a step by automatically installing the new self-signed SSL certificate into the Web server's certificate store. The /v option specifies the number of days the certificate will be valid. I estimated that I'd decommission my old Web server within 6 or 7 months, so I specified /t:200. The option's default value is 7 days, which is probably adequate for those who simply want to set up a Web server for testing.

SelfSSL has just three more options—/k, /p, and /q. The /k option lets you specify a key length in bits—the default is 1024, and that's fine for me. The /p option lets you set the SSL port number—the default is 443, which is what most systems use for SSL, so the option's probably not usually necessary. The /q option tells SelfSSL to run quietly, with no output.

Right Time, Right Place
SelfSSL came in handy just when I needed it. From the moment I realized I could use SelfSSL to create a temporary certificate to the moment I fired up the tool and did the job, only 4 minutes elapsed. You gotta love that kind of service!

End of Article



Reader Comments
good article

muraty February 15, 2006 (Article Rating: )


Hello
I tried same steps but always have this error :
Failed to generate the cryptographic key: 0x5
note : my loacl machine DNS is different from innternet mail Domain name (like x.com ), my mail server is different (like y.com)

mtawfiq February 21, 2006 (Article Rating: )


Should have included the syntax for the /s option. I think 80% of all certs created will need this option.

jbogdan August 09, 2006 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
CES 2009: Ballmer Announces Windows 7, Windows Live, Live Search Milestones

During his first-ever Consumer Electronics Show (CES) 2009 keynote address last night in Las Vegas, Microsoft CEO Steve Ballmer announced the pending public availability of a feature-complete Windows 7, the final version of Windows Live Essentials, and ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Where is Microsoft NetMeeting in Windows XP?

...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing