MSXML2.ServerXMLHTTP and TLS1.2

Okay, so most webservers now have TLS 1.0 and 1.1 disabled, which of course causes code to fail. Also the case for a classic ASP script using MSXML2.ServerXMLHTTP, so Google to the rescue and found this:

It was, surprisingly, easy to convert my existing code in the actual application to use WinHTTP, which appears to work properly enforcing TLS 1.2 on all calls from XP POSReady and Windows 10 (the OS’s where this application will be deployed).

While this isn’t an answer as to why POSReady and XMLServerHTTP calls try to use TLS 1.0 on the first call (despite the registry stating that’s not desirable), it is an acceptable workaround.

For others who may stumble upon this and are hesitant, converting my code was as simple as this:

Set XMLReceive = CreateObject("Msxml2.DOMDocument.6.0")
Set XMLServer = CreateObject("Msxml2.ServerXMLHTTP.6.0")
XMLServer.setTimeouts ResolveTimeoutMs, ConnectTimeoutMs, SendTimeoutMs, ReceiveTimeoutMs

XMLServer.setRequestHeader "User-Agent", "My XML App V1.0"
XMLServer.setRequestHeader "Content-type", "text/xml"
XMLServer.Open "POST", Server_Address, False
XMLServer.send (My_XML_Request_String_or_XML_Document)
Failure = (XMLServer.Status <> 200)
If Not Failure Then XMLReceive.loadXML (XMLServer.ResponseXML.XML)

to:

Set XMLServer = CreateObject("WinHttp.WinHttpRequest.5.1")
Set XMLReceive = CreateObject("Msxml2.DOMDocument.6.0")
XMLServer.setTimeouts ResolveTimeoutMs, ConnectTimeoutMs, SendTimeoutMs, ReceiveTimeoutMs

'force TLS 1.2
XMLServer.Option(9) = 2048
XMLServer.Option(6) = True

XMLServer.Open "POST", Server_Address, False
XMLServer.setRequestHeader "User-Agent", "My XML App V1.0"
XMLServer.setRequestHeader "Content-type", "text/xml"
XMLServer.send (My_XML_Request_String_or_XML_Document)
Failure = (XMLServer.Status <> 200)
If Not Failure Then XMLReceive.loadXML (XMLServer.ResponseText)

Good luck!

Saving Energy

We all have to save some. It starts with the realisation what you are actually using energy for… continue to read some facts/indications in Dutch:

1 standaard kubieke meter gas (m3(n)) heeft een bovenwaarde van 35,17 MJ
1 kWh electriciteit heeft een energie inhoud van 3,6 MJ.

Berekening
1 m3(n) gas komt overeen met 35,17 MJ/3,6 MJ = 9,769 kWh electriciteit

Met 1 kWh kunt u ongeveer…
20 maaltijden in de magnetron opwarmen,
4 avonden tv kijken,
30 uur uw koelkast laten koelen en vriezen,
15 cd’s luisteren.

Met 1 kubieke meter gas kunt u ongeveer…
1 uur uw huis warm stoken in de winter,
3 keer douchen – of 5 keer met een spaardouche,
1 keer in bad,
6 hele maaltijden koken,
50 keer handenwassen.

So how to save some energy?
Wear something warm and read a book by candlelight!

Windows 10 Intel ATOM and GMA 500 drivers

TO ANYONE USING WIN10 WITH OLD INTEL ATOM PROCESSORS/ INTEL GRAPHICS MEDIA ACCELERATOR 500
After hours of trying different graphic drivers for an old Acer Aspire One 751h (Atom Z520 1.33/2gb/250gb), where the last version provided on Acer support site (8.14.10.2003) is bugged, and newer ones like 8.14.10.2230 that claims to support Z500 processor Series but isn’t even recognized on win10 as a valid driver to Intel GMA500 adapter, I found a driver version that works without bugs (so far): 5.0.0.2030. Thank you: reddit.

So, to anyone trying to install this specific graphic card driver, don’t waste time trying to install the ‘latest’ driver/software, just go with the latest driver release FOR the graphic card. You can find a copy here.
When searching Intel you get nothing, thanks!
When installing, you will have to set the file properties of setup.exe to compatibility mode first so it thinks it’s running on Windows 7.

Honestly, Windows 10 works on an old laptop like this, but is slow as $h*7! I’m going back to Windows 7 on this one, to keep the machine useable.

Disk clone in 2020

Imagine a laptop with a doubtful drive, slow response, long waittimes, just something is wrong. You have another spare drive, plus a USB encasing to connect this other drive to your laptop. So all you want to do is swap them out and copy the complete Windows 10 OS from the original to the spare drive. How do you clone this? And since this is a personal thing, some free software would be best.

Continue reading Disk clone in 2020

PHP variables and strings

Sometimes you have to be reminded of the basics:

“How to use a dollar-sign $ in a string?”
In single quotes a dollar sign isn’t parsed as anything. Nothing is auto parsed in single quotes in php. If you use double quotes they are automatically parsed:

echo "$var"; // this will print the value of $var;
echo '$var'; // this will print $var;
echo "\$var";// this escapes the dollar sign so it will print $var;

ASP MDB x64 issue

ADODB.Connection error '800a0e7a'
Kan de voorziening niet vinden. Mogelijk is deze niet juist geïnstalleerd.
/someaspfile.asp, line 123

Okay; moved to a new server… Windows 2016 Standard, 64 bit
So now what? Well, you could read here.

ASP Error: ADODB.Connection error ‘800a0e7a’ Provider cannot be found. It may not be properly installed.
Without naming a source the answer is: “Never mind.  I found the answer on another forum.  “Enable 32-bit applications” needs to be enabled in the connection pool for the website, within IIS Manager 7.”

But how? Well, just:

  • Start Internet Information Services (IIS) Manager
  • Go to your application pools
  • Click on “DefaultAppPool”
  • Click on “Advanced Settings”
  • In General, set “Enable 32-bit Applications” to true

That’s all folks!
Contact My Brain if you need any help!

Disable These Files Might Be Harmful to Your Computer Warning

source: https://winaero.com/blog/disable-these-files-might-be-harmful-to-your-computer-warning/

Disable These Files Might Be Harmful to Your Computer Warning in Windows 10

If you connect a network share, i.e. mount a network drive by IP address of the server, Windows 10 displays a warning message These Files Might Be Harmful to Your Computer when you are opening files stored there. Here’s how to get rid of it.

Continue reading Disable These Files Might Be Harmful to Your Computer Warning

MySQL user not connecting

Problem:
Windows Server 2016, IIS Website, Setup a MySQL server/database, setup a WordPress website, quickly connect with root and root-password. Everything works fine!

Now you want things more secured, so you add a MySQL user with a password and rights to only the wordpress database. Change wp-config.php with the new login and you get a “Error Establishing a Database Connection” when accessing the WordPress website or admin.

Change back to root and the problem is solved. How to fix this?

Continue reading MySQL user not connecting

SEO tips from the guru

Again, found and pasted here; to keep for myself and later use.
Article from March 2018, but still valid I think. Original link: https://www.seoguru.nl/handleiding-seo/seo-tips/ = the last chapter of https://www.seoguru.nl/handleiding-seo/

SEO tips: een volledig en actueel overzicht

Tot slot van deze handleiding geef ik hier een samenvatting in de vorm van SEO tips. Ze zijn hieronder zoveel mogelijk uitgesorteerd naar het stadium van de ontwikkeling van de website. De lijst wordt regelmatig bijgehouden. Indien u zaken ziet die naar uw mening anders moeten of indien u tips mist, dan hoor ik dat graag. Dank!  

Continue reading SEO tips from the guru