IIS7 SSL works once but then stops. 

Problem:


You installed an SSL Certificate and went to HTTPS://www.domain.com it would work the first time, but then if you close your browser, and go back to HTTPS://www.domain.com it stops working

If you have already done some research on the issue or if you notice in your event viewer logs the event id 15300, 15301 like the one below then you can fix this error by using the resolution I used:


The description for Event ID ( 15301 ) in Source ( HTTP ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: \Device\Http\ReqQueue, 0.0.0.0:443.


Resolution:



What I did to fix this was to setup IP based rules. Example is say your server's IP is 192.168.0.100 and the port is 8520 then you would add the SSL Cert using the netsh command.

If you don't know what your cert hash is you can open your certificates manager and view your SSL certificate.

I'll provide more instructions later when I have time to write out better instructions ;-)

[ add comment ] ( 148 views )   |  [ 0 trackbacks ]   |  permalink  |   ( 3.1 / 33 )
Classic ASP and Facebook Connect 
I wrote a simple Classic ASP game called Never Ending Maze back in 1998. It was in fact the first thing I wrote in ASP (VBScript) and how I learned how to program in VBScript. Anyhow in order to get facebook to interface with it I simply used the "Connect" button. Here's how the HTML code looks:



login.asp



<a href="http://www.facebook.com/login.php?v=1.0&api_key=APIKEY&next=http://www.neverendingmaze.com/fb_connect.asp"><img id="fb_login_image" src="images/Connect_with_facebook_iphone.png" alt="Connect"/></a>


After that hard bit of code was done, I wrote the simple fb_connect.asp page. This page handles the request, and communicates back to facebook to get the cookie. Once it has the cookie it will automatically redirect you to the /login.asp page. If it doesn't get the cookie, then it will refresh the page until it finally does. Do note that if you disable third party cookies this may not work:

fb_connect.asp



<%
Dim fb_uid,ApiKey
fb_uid = ""
ApiKey = "183f81e6ef8024631ed9c91feb9e0d84"
fb_uid = Request.Cookies(ApiKey & "_user")
Session("fb_uid") = fb_uid
If IsNumeric(fb_uid) And Len(fb_uid) > 2 AND Len(Request.Cookies(ApiKey & "_session_key"))>2 Then
Response.Redirect "/login.asp"
End If
%>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head runat="server">
<title>Never Ending Maze - Loading Facebook Connect...</title>
<script>
function refresh()
{
window.location.reload();
}
setTimeout("refresh()",1700);
</script>
<meta http-equiv="refresh" content="2">
</head>
<body style="background-color:#000000;">
<form id="form1" runat="server">
<div>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">
FB.init("183f81e6ef8024631ed9c91feb9e0d84", "xd_receiver.htm");
</script>
loading ...
</div>
</form>
</body>
</html>


It's as easy as that to make a classic ASP page work with Facebook's Connect.

[ 4 comments ] ( 158 views )   |  [ 0 trackbacks ]   |  permalink  |   ( 3.2 / 41 )
Setting up PPTP VPN on Debian for your iPhone 
Debian setup is as simple as the following lines:

Install poptop

# aptitude install pptp

Edit pptpd config files

/etc/pptpd.conf

The file should look like this:

option /etc/ppp/pptpd-options
logwtmp
localip 192.168.0.1
remoteip 192.168.0.10-20


Set them to whatever private (or public) ip addressing you want. You could use IP addresses currently available in your network, if you do this you will not need to add the iptables rules for natting later in this guide.

Your /etc/ppp/pptpd-options should look like this:

Option 1
Set ms-wins and ms-dns to the name server the server you are currently working on is using (look in reolv.conf).

Option 2
Or as I did install dnsmasq on the server and run it as a chaching dns server

# aptitude install dnsmasq

And then set ms-dns and ms-wins to 192.168.0.1 (or the localip you set)

/etc/ppp/chap-secrets

Setup users and passwords to connect the pptp server

username pptpd somepassword *

Turn on IP Forwarding

# echo 1 > /proc/sys/net/ipv4/ip_forward

Set the change permanantly in /etc/sysctl.conf by uncommenting the line:

net.ipv4.ip_forward=1

Turn on NATing

If you have created a new private network for your pptpd server, you probably have, you need to add a rule to iptables.

# iptables --table nat --append POSTROUTING \
--out-interface eth0 --jump MASQUERADE

But this rule needs be persistant so we need to create a script to run when the interface starts up

# iptables-save > /etc/iptables.conf

Create a new file: /etc/network/if-up.d/iptables and paste in the following

#!/bin/sh
/sbin/iptables-restore < /etc/iptables.conf

Set it to executable
# chmod 755 /etc/network/if-up.d/iptables

All Done!. Just startup pptpd

# /etc/init.d/pptpd start


On your iPhone use the following picture as a guide:


[ add comment ] ( 74 views )   |  [ 0 trackbacks ]   |  permalink  |   ( 3 / 30 )
Enable Password Never Expires in Active Directory 
Here's a very simple script I wrote in VBScript to reset this flag if it doesn't exist for all users in any given OU.


Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000
Set objContainer = GetObject("LDAP://cn=Users,dc=domain,dc=local")
objContainer.Filter = Array("user")
For Each objUser In objContainer
lngFlag = objUser.Get("userAccountControl")
If (lngFlag And ADS_UF_DONT_EXPIRE_PASSWD)=0 Then
lngFlag = lngFlag Xor ADS_UF_DONT_EXPIRE_PASSWD
objUser.Put "userAccountControl", lngFlag
objUser.SetInfo
wScript.echo objUser.Name
End If
Next


[ add comment ] ( 61 views )   |  [ 0 trackbacks ]   |  permalink  |   ( 3.3 / 39 )

| 1 | 2 | Next> Last>>