Create a Public and Private key PFX and Certificate file in simple steps.
Assuming that you have OpenSSL installed in a windows environment. Commonly its C:\Program Files (x86)\GnuWin32\bin>. For simplicity move the openssl.cnf to the local C:\ drive so it can be referenced from there.
Start a Command window as Administrator and navigate to the OpenSSL exe. (C:\Program Files (x86)\GnuWin32\bin>)
--Start the process, pick your curve you want (this one is prime256v1)
openssl ecparam -genkey -name prime256v1 -out privatekey.pem
--Next step is to create the Public certificate which will ask you a few questions.
openssl req -new -x509 -key privatekey.pem -out publickey.cer -days 365 -config c:\openssl.cnf
--Final step creates the Private pfx file
openssl pkcs12 -export -out public_privatekey.pfx -inkey privatekey.pem -in publickey.cer
You will end up with a few files which will be the Public certificate and Private PFX file.
Tuesday, 30 August 2016
Thursday, 11 August 2016
Asp Net Core MVC Change Folder Name And Now The Site Wont Run Anymore
So, you created a nice new project and realise that you spelt something wrong in the folder structure, something like the example below.
When is should have been...
Now this should be a simple thing of renaming the folder, updating whatever source control you use and its back to work again.
Unfortunately it's not, when I first did this by creating new project in Visual Studio 2015, corrected the folder name and then tried to run the project again I got a error dialog appear directing me to where the error was logged.
A snippet of the error logged is below.
C:\Git\XmlXsltValidator
When is should have been...
C:\Git\XmlXsdValidator
Now this should be a simple thing of renaming the folder, updating whatever source control you use and its back to work again.
Unfortunately it's not, when I first did this by creating new project in Visual Studio 2015, corrected the folder name and then tried to run the project again I got a error dialog appear directing me to where the error was logged.
A snippet of the error logged is below.
HTTP Error 500.19 - Internal Server Error
Config Error Cannot read configuration file Config File \\?\C:\Git\XmlXsltValidator\src\XmlXsltValidator\web.config
To fix this I opened up the applicationhost.config, following the path described above, and then scrolled down to the system.applicationHost\sites node and noticed that were three sites which one was pointing to the old folder location. I removed this element, closed and reopened the solution and it was working again.
Incorrect XML
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
<site name="XmlXsltValidator" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Git\XmlXsltValidator\src\XmlXsltValidator" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:61097:localhost" />
</bindings>
</site>
<site name="XmlXsdValidator" id="3">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Git\XmlXsdValidator\src\XmlXsdValidator" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:61097:localhost" />
</bindings>
</site>
Correct XML
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
<site name="XmlXsdValidator" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Git\XmlXsdValidator\src\XmlXsdValidator" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:61097:localhost" />
</bindings>
</site>
Wednesday, 3 August 2016
Javascript getYear() is not returning correct year
getYear() has a Y2K bug so if you need the actual year then call the getFullYear() method.
Tuesday, 2 August 2016
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Getting this issue?
Goto Protocols for MSSQLSERVER and enable TCP/IP and check the IP configuration is enabled
Goto Protocols for MSSQLSERVER and enable TCP/IP and check the IP configuration is enabled
Subscribe to:
Posts (Atom)