Bài đăng

Create self signed cerfiricate SSL

Hình ảnh
Creating a Self – Sign SSL Certificate Overview A self-signed certificate is a certificate that is signed by itself rather than a trusted third party. This means you can't verify that you are connecting to the right server because any attacker can create a self-signed certificate and launch a man-in-the-middle attack. Because of this, you should almost never use a self-signed certificate on a public IIS server that requires anonymous visitors to connect to your site. However, self-signed certificates can be appropriate in certain situations: Generate a Self-Signed Certificate with the Correct Common Name: This step is only required if you want to get rid of the warning message displayed because the common name on the self-signed certificate doesn't match the website's hostname. In order to resolve this problem, we'll need to create the self-signed certificate using the same method that is used to create a self-signed certificate in IIS 6.0 (with SelfSSL in...

Add và Load file js bằng javascript với callback event

Trường hợp bạn muốn add file *.js bằng javascript: Hàm "loadScript" dưới đây sẽ add và load file js khi bạn gọi, với 2 tham số truyền vào là đường dẫn file *.js (sScriptSrc) và hàm sẽ đc thực thi khi file đc load xong (Callback func) oScript.onreadystatechange on IE và oScript.onload on firefox browser. function loadScript(sScriptSrc,callbackfunction) { //gets document head element var oHead = document.getElementsByTagName('head')[0]; if(oHead) { //creates a new script tag var oScript = document.createElement('script'); //adds src and type attribute to script tag oScript.setAttribute('src',sScriptSrc); oScript.setAttribute('type','text/javascript'); //calling a function after the js is loaded (IE) var loadFunction = function() { if (this.readyState == 'complete' || this.re...