473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Dump client certificates from SSL to file?

Hi

I'm using the following ASP-page (taken from http://support.microsoft.com/default...b;en-us;216829) to dump client certificates from an SSL connection to a file on the webserver. It worked fine before on an IIS5 but now, using IIS6 it gives me a strange output. (see at the end of the messege)

Here's the code
<% @Language = VBScript %><% Response.Buffer = True %><html><head><title>Client Certificate Capture</title></head><body><%
'Obtain client nam
cname = Request.ClientCertificate("SubjectCN"
'Instantiate the ASP FileSystemObject in order to create a text fil
Set fs = Server.CreateObject("Scripting.FileSystemObject"
'Create text file using append mode. The client name is used to create the file name.
Set outStream = fs.OpenTextFile( "c:\inetpub\wwwroot\dump\" & cname &".txt" , 8, True
'Save certificate issuer information to text fil
outStream.WriteLine( "# Issuer: " & Request.ClientCertificate("Issuer")
'Extract certificate subject (user) and account informatio
'from certificate
su = Request.ClientCertificate( "Subject"
mx = len(su)
for x = 1 to m
if mid(su,x,1)=chr(10) or mid(su,x,1)=chr(13) the
su=left(su,x-1)+";"+right(su,mx-x)
end if
nex
outStream.WriteLine( "# Subject: " & su
outStream.WriteLine( "# Account: " & Request.ServerVariables("REMOTE_USER")
'Extract encrypted certificate text from certificate; encode text as 64-bit data
uue = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw xyz0123456789+/
outStream.WriteLine( "-----BEGIN CERTIFICATE-----"
cer = Request.ClientCertificate("Certificate"
lcer = len(cer)
l = 0
for x = 1 to lcer step
a1 = asc(mid(cer,x,1))
if x+1 <= lcer the
a2 = asc(mid(cer,x+1,1))
if x+2 <=lcer the
a3 = asc(mid(cer,x+2,1))
els
a3 = 0
end if
els
a2 = 0
a3 = 0
end i
outStream.Write mid(uue, (a1 and 252)/4 +1 ,1
outStream.Write mid(uue, (a1 and 3)*16 + (a2 and 240)/16 +1 ,1
if x+1 <= lcer the
outStream.Write mid(uue, (a2 and 15)*4 + (a3 and 192)/64 +1 ,1
if x+2 <= lcer the
outStream.Write mid(uue, (a3 and 63) +1 ,1
else
outStream.Write "=
end if
else
outStream.Write "==
end if
l = l +4
if l = 64 the
outStream.WriteLine("")
l = 0
end i
next
if l > 0 then
outStream.WriteLine( ""
end if
outStream.WriteLine( "-----END CERTIFICATE-----"
Response.Write "Client certificate information has been received and logged successfully<br>
%></body></html

And here's the output
-----BEGIN CERTIFICATE----
Pz8/Pz9BP34/Pz8/Pz9hPyA/uz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz+vPz8/Pz8
Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/P7s/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8
Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz9jYQU/jT8/Pz8
Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/OT8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/BT8
Pz8/Pz8/Pz8/Pz8/Pz8/YUE/Pz8/Pz8/Pz8gPz8/Pz8/Pz8/Pz8/Pz+7Pz8/TGE
Pz8/QT8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/P2E/rz8/Pz8/Pz8/Pz8/Pz8/Pz8
Pz8/Pz8/Pz8/Pz8/Pz8/Kz8/Pz8/Pz8/Pz8/Pz8/Pys/Pz8/Pz8/Pz8/Pz8/Pz8
Pz8/Pz8/Pz8/Pz8/Pz8/Yz8FP4E/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8
Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/Pz/FPz8/Pz8/Pz8/Pz8/Pz8
-----END CERTIFICATE----

Anyone seen and solved this problem
Best regards
/Jonas
Jul 19 '05 #1
0 1414

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eric Paschoalick Chaves | last post by:
Hi Folks, I'm trying to implement a webservice that requires SSL with client certificates. I'd like to use MS certificate server to (ie My own CA) in order to issue the client certificates, but...
4
by: Matt Frame | last post by:
I am working on a special ASP.Net application that receives files from customers. The connection is made via HTTPS and the client sends the file as a POST to my ASP.Net listener. All of this...
0
by: dinoo | last post by:
Can some body help me out? I am trying to use client certificates in a Webservice. But some how i am not able to make it. I went through the msdn resources but i think some one needs to help me...
5
by: wrytat | last post by:
I'm not sure if I'm posting the correct place. I posted it somewhere else, but someone told me to post it at another place. Anyway, some background first. I am currently building a web...
0
by: Ankur Tyagi via .NET 247 | last post by:
Hey, I have been trying to actually explore the various certificates available across all the platforms. I had started with Microsoft Certiying Authority of the microsoft. I had actually created a...
5
by: | last post by:
Hi all, HttpWebRequest, and SoapHttpClientProtocol both expose a ClientCertificates property, which can hold multiple client certificates, but on the service side, it can only receive one client...
1
by: WebServiceSecurity | last post by:
The issue involves the following technologies: - 1. .NET 2.0 Framework 2. WSE2.0 (WS-Security) 3. X.509 certificates 4. BEA Weblogic 8.1.5
2
by: steveS | last post by:
Hi all, I'm having trouble connecting to a Java web service using HttpWebRequest. I get the error message "The request was aborted: Could not create SSL/TLS secure channel". The Java service...
3
by: mzarlenga | last post by:
I have a WCF .NET 3.0 self-hosted service and client. Both client and server are on the same system. My service opens a secure endpoint and is configured to demand a client-side certificate: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.