Monday, December 21, 2020

ASP.Net IIS web application send all requests via proxy without code change

For your web application, edit the web.config file (in the app root) and add as shown below. Note: you may already have a system.net or configuration section. You will have to add the defaultproxy section to the existing parent elements as needed

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.net>
    <defaultProxy enabled="true" useDefaultCredentials="true">
      <proxy proxyaddress="http://proxyservername:proxyserverport/" bypassonlocal="false" usesystemdefault="false" autoDetect="false" />
    </defaultProxy>
  </system.net>
</configuration>

IIS giving 403 unauthorized while doing certificate based authentication

1. Check iis logs. It should have http sub state and win32 error code. In my case this was 16 (so full http code was 403.16) and 2148204809 (and sometimes 2148204801)

2.  Error 2148204809 translate root certificate or some in chain is invalid

3. Checking the root certificate, it was found to be valid

4. The following command was run in the PowerShell to see if there was any invalid root certificates

Get-Childitem cert:\LocalMachine\root -Recurse |
Where-Object {$_.Issuer -ne $_.Subject} | Format-List * | Out-File "c:\computer_filtered.txt"

It turns out we had a Godaddy Certificate that got revoked recently in the system. Removing this solved the issue. It was very strange why an unrelated certificate revocation can cause auth issues for a site that do not even use that certificate.

 

Note: 

Just in case the above is not working, you can try below as a test. Its not clear leaving these on is recommended or not


Open registry and navigate to below

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL

Add two 32 bit DWORD keys and set values as below

  • SendTrustedIssuerList = 0 (stop sending list of trusted root certification authorities during the TLS/SSL handshake process)
  • ClientAuthTrustMode = 2 (Set trust mode to Exclusive CA Trust, requires that a client certificate chain to either an intermediate CA certificate or root certificate in the caller-specified trusted issuer store.)

 

Note 2:

Not related to above, but most of the time certificate based auth fail due to access issues to certificate private keys. Check to make sure the client has access to private keys of the certificate (and same in iis, where the iis app pool user has access to private keys used in certificate)

Monday, December 7, 2020

Unreal - Input Action mapping (keyboard presses or mouse clicks) not firing in BP event

For Keyboard presses and Mouse clicks to be recognized, make sure that in blue print class defaults, Auto Receive Input is set to Player 0

Turn on Windows 11 Fast Boot

If windows starting is slow, to enable windows 11 fast startup/boot,  Press Windows + R, type powercfg.cpl, and hit Enter.  This will direct...