SOAP UI Exception: java.net.BindException: Address already in use: connect

This exceptions may occur when load testing on a windows based system. It typically
is thrown when testing a service with a lot of request in a short amount of time.

To prevent this exception from being thrown you can change the TcpIp parameters in the windows registry:

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Add a new DWORD key with the name “MaxUserPort” and a decimal value of 65534.

See also here

Posted in SoapUI | Leave a comment

C# and System.Diagnostics.Trace

An excellent article about how to instrument your code can be found here.

Posted in ASP.NET, C# | Leave a comment

Install SVN on your Synology DS211+

On the SynologyWiki is an excellent article about installing Subversion on to your synology diskstation. You can also integrate SVN with your visual studio environment (almost like TFS). With the software from ankhSVN, for example, you can perfectly integrate SVN and Visual Studio (2008).

Use the Options window to configure the ankhSVN plugin:

image

The file “app.config” is checked out; other files are also under version control

image

View all of your pending changes.

image

There is also the ability to integrate SVN with Eclipse Helios. A good installation instruction can be found here.

Posted in Uncategorized | Leave a comment

Custom SSL certificate on Synology DS211+

The original post can be found here (for archiving purposes and quick access I have copied this to my blog)

Continue reading

Posted in Handy | Leave a comment

Configure IIS Website with SSL

To secure your website you can use SSL and certificates. In this post I will explain in detail how to setup your site to use a certificate, including the details of installing your own Certification Authority. Finally I will show you some C# code to work with certificates.

Part 1 will show you how to install the Certificate Authority on a Windows 2003 machine, part 2 is about creating a new website,
part 3
shows how to request a webserver certificate,
part 4 shows you how to send the request to the Certification Authority,
part 5
shows you how the CA processes the request,
part 6
shows you how to download and install the certificate on the website, 
part 7
shows you how to create a virtual folder.
Part 8 shows you how to test ths site together with some coding examples in C#.

Posted in C#, Security, VS200[5][8] | Tagged , , | Leave a comment

Enable the ASP.NET tab (again)

  1. Stop the IIS Admin service (and any services that depend on it)
  2. Open C:\WINDOWS\system32\inetsrv\MetaBase.xml in notepad or your favorite XML Editor. DELETE the line that reads ‘Enable32BitAppOnWin64=”TRUE”‘
  3. Start -> Run -> iisreset
Posted in ASP.NET | Leave a comment

Part 6 – Download the Issued certificate

To secure your website you can use SSL and certificates. In this post I will explain in detail how to setup your site to use a certificate, including the details of installing your own Certification Authority. Finally I will show you some C# code to work with certificates.

Part 1 will show you how to install the Certificate Authority on a Windows 2003 machine, part 2 is about creating a new website,
part 3
shows how to request a webserver certificate,
part 4 shows you how to send the request to the Certification Authority,
part 5
shows you how the CA processes the request,
part 6
shows you how to download and install the certificate on the website,
part 7
shows you how to create a virtual folder.
Part 8 shows you how to test ths site together with some coding examples in C#.

image_thumb24_thumb_thumb Go back to CertSrv website and choose View the status of a pending request.
image_thumb25_thumb_thumb Click Saved-request…..
image_thumb26_thumb_thumb Click Download certificate and store it for example on your Desktop.
image_thumb28_thumb_thumb Select the SSLWebSite in the inetmgr and choose properties.
image_thumb29_thumb_thumb Select the Directory Security tab.

Click Server Certificate

image_thumb30_thumb_thumb Click Next
image_thumb31_thumb_thumb Click Next
image_thumb32_thumb_thumb Select the .cer file save on your Desktop

Click Next

image_thumb33_thumb_thumb Click Next
image_thumb34_thumb_thumb Click Next
image_thumb35_thumb_thumb Click Finish
image_thumb36_thumb_thumb As you can see on the properties window the certificate is installed on the website and you can view the details with the View Certificate button.
image_thumb37_thumb_thumb You can see that it is Issued to locsp.locrdw.tld (the common name) and that it is Issued by locspca (the name of the CA).
Posted in C#, Security | 6 Comments

Part 5 – Certificate processing by the CA

To secure your website you can use SSL and certificates. In this post I will explain in detail how to setup your site to use a certificate, including the details of installing your own Certification Authority. Finally I will show you some C# code to work with certificates.

Part 1 will show you how to install the Certificate Authority on a Windows 2003 machine, part 2 is about creating a new website,
part 3
shows how to request a webserver certificate,
part 4 shows you how to send the request to the Certification Authority,
part 5
shows you how the CA processes the request,
part 6
shows you how to download and install the certificate on the website,
part 7
shows you how to create a virtual folder.
Part 8 shows you how to test ths site together with some coding examples in C#.

image_thumb20_thumb Start de Certification Authority tool (Start –> Administrative Tools) and select the Pending Request.
image_thumb21_thumb Right click the pending request that you want to process; choose All tasks and select Issue.
image_thumb23_thumb The pending request is now moved to the Issued Certificates entry.
Posted in C#, Security | 3 Comments

Part 8 – Test the SSL site

Now we are going to perform some tests with the SSL site. Follow the steps in the table shown below.

image_thumb[45]_thumb Create a html file in the new virtual folder and browse the file.
image_thumb[46]_thumb The internet explorer is started and the URL
http://localhost:82/SSLSite/test1.html is opened.
image_thumb[47]_thumb Now change this URL to:
https://localhost:444/SSLSite/test1.html 

The screen on the left appears indicating a problem. The problem is that localhost is not the site this certificate is issued to; it is issued to locsp.locrdw.tld; you can select continue to this website….

image_thumb[48]_thumb The page is shown. The address bar has a red background color.

Click Certificate Error

image_thumb[49]_thumb This clearly shows the problem: Mismatched Addresslocalhost is not locsp.locrdw.tld!

Now change the URL to:
https://locsp.locrdw.tld:444/SSLSite/test1.html

image_thumb[50]_thumb The certificate error disappeared and the background color of the address bar turned white again.

 

image_thumb[51]_thumb Click the SSL symbol (padlock) at the very end of the address bar and then select View certificates you can see the server certificate information.
image_thumb[52]_thumb Now try to test this from  another (virtual machine).

Click Certificate Error

image_thumb[53]_thumb Now you get the error Untrusted Certificate. This is because locspca is not a Trusted Root Certification Authority.
image_thumb[55]_thumb When you press View certificates you can see the detailed error message:

The certificate cannot be verified up to a trusted certification authority.

We have installed our own Certification Authoriy and we can request a client certifate from this CA. The table below outlines the actions to take.

image_thumb[57]_thumb Now we are going to request a client certificate from the CA.

Go to the URL http://locsp.locrdw.tld/certsrv/

An error message appears when you try this on a Windows 7 / Vista client (an ActiveX component cannot be loaded).

On your CA server navigate to the specified URL and install the update (direct link here).

image_thumb[58]_thumb Start the update.

Click Next

image_thumb[59]_thumb Choose I agree

Click Next

image_thumb[60]_thumb Click Finish

The asp files in the CertServ virtual folder are updated.

image_thumb[61]_thumb Now return to http://locsp.locrdw.tld/certsrv/ and you should see the screen shown on the left.

Click Request a certificate

image Click advanced certificate request
image Click Create and submit a request to this CA
image An error message appears: “In order to complete certificate enrollment, the Web site for the CA must be configured to use HTTPS authentication”.

This (https authentication) is not the real problem here. As shown at the top of the screen an activex control needed for requesting a certificate cannot be loaded.
To solve this problem you have to take two steps. Step 1; add the locsp.locrdw.tld to your trusted sites AND step 2, enable the loading of the ActiveX control.

image Step 1. In internet explorer go to Tools –> Internet Options. Select the tab security. Select the item Trusted Sites. Click the Sites button. Uncheck the Require server verification….. Type http://locsp.locrdw.tld in the texbox

Click Add

Click Close

image Step 2. Press custom level. Go to the category ActiveX controls and plug-ins; select the item Initialize and script ActiveX controls not marked as safe for scripting and enable this.

Click Ok

image Click Yes
image Press “F5” to refresh the screen.

Click Yes

image Fill in the form.

Click Submit

image The server is generating a request based on your input and responds with a request id.

Now the Certification Authority has to take action to issue your certificate.

By now we have made a request to the CA for a new certificate. The CA has to process this request.  The table below outlines the actions to take.

image Go to your CA server and start the “Certification uthority tool; go to the Pending request tab; right click the certificate; choose All tasks and select Issue.

The certificate is issued at this time.

By now the CA has Issued (approved)  your certificate request. We now have to retrieve it from the CA’s website. The table below outlines the actions to take.

image Still on the CertServ website click Home (at the very right).
image Click View the status of a….
image Click Client Authentication Certificate….
image Click Yes
image Click Install this certificate
image Now you get an error message saying that the CA is not trusted. That is correct because our “locspca” is not known to the outside world.

Click install this CA certificate

image Click Open
image Click Install Certificate…
image Click Next
image Click Place all certificates in the…..

Click Browse and select Trusted Root Certification Authorities.

Click Next

image Click Finish

Click Yes

image Click Ok
image The locspca certificate is now stored in the Trusted Root Certification Authorities certificate store.

You can check this by starting MMC and adding the Certificates snap-in for the Current User and then select the Trusted Root Certification Authorities store.

image Go back to the internet explorer and select Install this certificate.
image Now the certificate is installed to the Personal store of the current user.
image As you can see the certificate is stored in the Personal store.
image To let the website ask a user for a certificate we have to indicate this.

Go to the properties of the virtual folder SSLSite.

Select the Directory Security tab and press Edit.

image Check Require secure channle (SSL).

Select Require client certificate.

Click Ok

After this change we no longer can access this site on port 82 (not using SSL).

image Now when you navigate to
https://locsp.locrdw.tld:444/SSLSite/test1.html
the server is requesting for a certificate.
image When there is no valid certificate found in your personal store the error message to left will appear.

HTTP Error 403.7 – Forbidden: SSL client certificate is required

Posted in C#, Security | 4 Comments

Part 7 – Create a virtual folder

To secure your website you can use SSL and certificates. In this post I will explain in detail how to setup your site to use a certificate, including the details of installing your own Certification Authority. Finally I will show you some C# code to work with certificates.

Part 1 will show you how to install the Certificate Authority on a Windows 2003 machine, part 2 is about creating a new website,
part 3
shows how to request a webserver certificate,
part 4 shows you how to send the request to the Certification Authority,
part 5
shows you how the CA processes the request,
part 6
shows you how to download and install the certificate on the website,
part 7
shows you how to create a virtual folder.
Part 8 shows you how to test ths site together with some coding examples in C#.

I assume that the website with the certificate is created and is called SSLWebSite. Now create a virtual folder that uses the certificate for SSL communication.

image_thumb[38] Start the inetmgr; right click SSLWebSite choose new; choose Virtual Directory.
image_thumb[40] Click Next
image_thumb[41] Enter the alias SSLSite.

Click Next

image_thumb[42] Create a folder for the virtual directory.

Click Next

image_thumb[43] Check Run scripts (such as ASP)

Click Next

image_thumb[44] Click Finish
Posted in C#, Security | 4 Comments