Base code merged to SPIN 2.4
[platform/upstream/curl.git] / lib / mk-ca-bundle.vbs
index d868079..2d82e7d 100755 (executable)
@@ -5,7 +5,7 @@
 '*                            | (__| |_| |  _ <| |___\r
 '*                             \___|\___/|_| \_\_____|\r
 '*\r
-'* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.\r
+'* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.\r
 '*\r
 '* This software is licensed as described in the file COPYING, which\r
 '* you should have received as part of this distribution. The terms\r
 '* Hacked by Guenter Knauf\r
 '***************************************************************************\r
 Option Explicit\r
-Const myVersion = "0.3.8"\r
-\r
-Const myUrl = "http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1"\r
+Const myVersion = "0.3.9"\r
 \r
+Const myUrl = "http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt"\r
 Const myOpenssl = "openssl.exe"\r
 \r
 Const myCdSavF = FALSE       ' Flag: save downloaded data to file certdata.txt\r
@@ -48,7 +47,7 @@ Set objHttp = WScript.CreateObject("WinHttp.WinHttpRequest.5.1")
 If objHttp Is Nothing Then Set objHttp = WScript.CreateObject("WinHttp.WinHttpRequest")\r
 myBase = Left(WScript.ScriptFullName, InstrRev(WScript.ScriptFullName, "\"))\r
 mySelf = Left(WScript.ScriptName, InstrRev(WScript.ScriptName, ".") - 1) & " " & myVersion\r
-myCdFile = Mid(myUrl, InstrRev(myUrl, "/") + 1, InstrRev(myUrl, "?") - InstrRev(myUrl, "/") - 1)\r
+myCdFile = Mid(myUrl, InstrRev(myUrl, "/") + 1)\r
 myCaFile = "ca-bundle.crt"\r
 myTmpName = InputBox("Enter output filename:", mySelf, myCaFile)\r
 If Not (myTmpName = "") Then\r
@@ -60,8 +59,8 @@ objHttp.SetTimeouts 0, 5000, 10000, 10000
 objHttp.Open "GET", myUrl, FALSE\r
 objHttp.setRequestHeader "User-Agent", WScript.ScriptName & "/" & myVersion\r
 objHttp.Send ""\r
-If Not (objHttp.statusText = "OK") Then\r
-  MsgBox("Failed to download '" & myCdFile & "': " & objHttp.statusText), vbCritical, mySelf\r
+If Not (objHttp.Status = 200) Then\r
+  MsgBox("Failed to download '" & myCdFile & "': " & objHttp.Status & " - " & objHttp.StatusText), vbCritical, mySelf\r
   WScript.Quit 1\r
 End If\r
 ' Convert data from ResponseBody instead of using ResponseText because of UTF-8\r