The NSS full support to encrypted communications based on software platforms of the LIUXU and WIN.
Last Version
http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_9_2_RTM/src/nss-3.9.2.tar.gz
http://ftp.mozilla.org/pub/security/nss/releases/NSS_3_9_2_RTM/WINNT4.0_OPT.OBJ/nss-3.9.2.zip
http://ftp.mozilla.org/pub/security/nss/releases/NSS_3_9_RTM/
http://ftp.mozilla.org/pub/security/nss/
http://ftp.mozilla.org/pub/security/nss/releases/NSS_3_9_RTM/
https://gentoobrowse.randomdan.homeip.net/packages/dev-libs/nss#uses
非常重要之总则,以下文件非常重要,乃是文件头的重要寻址与复制路径:
驱动器×:Program Files (x86)\Microsoft Visual Studio 10.0\VC
驱动器×:Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
驱动器×:Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
驱动器×:Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
驱动器×:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\
驱动器×:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
驱动器×:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
驱动器×:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
建设参考:
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Sources_Building_Testing
http://www.cnblogs.com/stone-pieliedie/p/3435828.html
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Building
https://www-archive.mozilla.org/projects/security/pki/nss/nss-3.9/nss-3.9-build.html
问题参考:https://github.com/openresty/lua-nginx-module/issues/1112
建立NSPR,DBM和NSS加密系统结构:
cd mozilla / security / nss(在Windows上,mozilla \ security \ nss)
gmake nss_build_all
安装的命令:
hg clone https://hg.mozilla.org/projects/nspr
hg clone https://hg.mozilla.org/projects/nss
1,对于Windows,请确保环境变量HOME设置为可写目录的名称,并且不以斜杠或反斜杠结尾,例如c:/ home
2,除Alpha / OSF1之外的Unix平台上,如果您希望构建系统的64位ABI,请在您的环境中设置USE_64 = 1
默认情况下,NSS为除Alpha / OSF1之外的所有平台上的32位环境构建。
3,如果你想要一个非调试优化版本, 在你的环境中设置BUILD_OPT = 1。否则,你会得到一个调试版本。
在Windows上,如果要使用系统的调试RTL库进行调试生成 ,请在您的环境中设置USE_DEBUG_RTL = 1。
设定系统变量:
set OS_TARGET=WIN95
set OS_TARGET=WINNT
在我的电脑->属性->高级->环境变量->系统变量中新建系统变量LIB、INCLUDE并设置它们的值:
LIB:
驱动器×:/Program Files/Microsoft SDK/Windows/v7.1/Lib;
驱动器×:/Program Files/Microsoft SDK/Windows/v7.0/Lib;
驱动器×:/Program Files/Microsoft SDK/Windows/v6.0A/Lib;
驱动器×:/Program Files/Microsoft SDK/Windows/v5.0/Lib;
驱动器×:/Program Files/Microsoft Visual Studio 9.0/VC/lib;
驱动器×:/Program Files/Microsoft Visual Studio 10.0/VC/lib
驱动器×:Program Files (x86)\Microsoft Visual Studio 10.0\VC
驱动器×:Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
驱动器×:Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
驱动器×:Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
驱动器×:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\
驱动器×:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
驱动器×:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
驱动器×:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
INCLUDE:
C:/Program Files/Microsoft Visual Studio 9.0/VC/include
C:/Program Files/Microsoft Visual Studio 10.0/VC/include
(1)解决驱动无法引导问题:
命令:
pushd "%~dp0"
call [your VC_INSTALL_PATH]\VC\vcvarsall.bat
cl
(2)解决无法打开文件:
1, error C1083: 无法打开包括文件:“stdint.h”
blog.csdn.net/q277055799/article/details/55270770
解决:从ming32/64把inttypes.h和stdint.h拿出来,放到vc的include目录就可以了。
2, 解决error C1083: 无法打开包括文件: “sys/time.h”的问题
blog.csdn.net/c_to_oop/article/details/77479282
解决:环境变量设定问题。返回前头。
3,fatal error C1083: 无法打开包括文件:“pcap.h”:
Win32 平台下WinPcap应用程序需要以下四个动态链接库才能正常运行: wpcap.dll Packet.dll WanPacket.dll pthreadVC.dll 这四个动态链接库在WinPcap驱动程序里。 如果没有这个驱动程序,需要到WinPcap官方网站上下载,下载地址为:www.WinPcap.org 如果应用程序出现一下提示,那就是没有安装驱动程序的原因了。
文章来自:http://blog.csdn.net/wjeson/article/details/7415888
注意:WanPacket.dll
文件: WanPacket.dll 大小: 68224 字节 文件版本: 4.1.0.902 修改时间: 2018024, 19:01:06 MD5: 73E982455A42B5FEA0F08280A0F47DDD SHA1: 8374E1AF0D5729DC80CF90791AB6EF683AE7877F CRC32: 47033DAC
4,fatal error C1083: 无法打开包括文件:“stddef.h”: No such file or directory
5,error C4335: 检测到 Mac 文件格式: 请将源文件转换为 DOS 格式或 UNIX 格式在VS2012安装吗目录下的这个文件夹 D:\Program Files\Visual Studio 2012\VC\include 找到了stddef.h文件,将其加到项目的包含目录中,OK。注意:D:\Program Files\Visual Studio 2012\VC\crt\src 中也有该文件,但不要加这个文件夹。
环境:VS2010
问题: error C4335: 检测到 Mac 文件格式: 请将源文件转换为 DOS 格式或 UNIX 格式
问题分析:多数因为复制代码产生。
解决:
1.利用Editplus:复制文件------>打开Editplus------->菜单栏--------->文档-------->文件类型-------->更改文件类型------->改为对应的平台。
2.利用UltraEdit:复制文件------->打开UltraEdit------->菜单栏--------->文件-------->转换------>转换成相应的格式。
3,利用VS2017的编辑功能可以统一修改——编辑,查找和替换中有四种方法可以选择。
6, fatal error C1083: 无法打开包括文件:“***.h”: No such file or directory
头文件一定要写成 #include " *.h " 即 #include "class.h" 这种形式.
X:\nss\security\nss\lib\util\WinNT.h(31,1):#include "ctype.h"
下面,已经为你修改好了.C文件和.h文件,下载使用即可。
修改过的.C文件下载(下载后解压复制到:.......security\nss\lib\util位置):
https://drive.google.com/file/d/1s3U3N2FPku86brqi5ZLhL-mgVqRH5-OB/view?usp=sharing
修改过的.h文件下载(下载后解压到:.......security\nss\lib\util位置):
https://drive.google.com/file/d/1DXE-F2Ftowh5UGJz0vmrIxvT37DU69f6/view?usp=sharing
7,如果缺少“plarena.h”问题,请删除源代码树中的以下目录 ,然后再次尝试:
“make nss_build_all” mozilla/dist mozilla/nsprpub / WIN954.0_DBG.OBJ
or
mozilla-build/dist
mozilla-build/nsprpub/WIN954.0_DBG.OBJ
当我们是直接将文件从别的地方添加到我们的工程中的时候,我们一定要保证那些文件也要移到我们的工程目录下,否则也会出现上面的问题.
因为 #include 后面的包含的文件时,如果使用的是 "<>" 尖括号的话, 表示让编译器在系统头文件夹中查找对应名字的头文件,。
当使用""""引号时,就是让编译器在当前程序目录下查找对应名字的头文件,如果没有找到,则编译器会再在系统头文件夹中查找该头文件.。
所以,这里,你应该把 #include <class.h> 改为 #include "class.h"
写法不标准,(但是能通过许多编译器) 应该这么写 #include <iostream> // 注意,标准中,系统头文件不推荐加 .h,类似地有 <cmath> 而不是 <math.h> #include "class.h" using namespace std; // 使用标准的名空间 int main(int argc, char *argv[]) // 标准 C++中 必须显式的申明 main 的返回值类型,不写的话有些编译器默认是 int 型 { float l, w, h; ... ... .. p[i].OutPut(); } return 0; // 记得返回值 }
(3)安装加密程序:
基本的最重要的命令:1,$ make -k nss_build_all
延展命令:2,$ make nss_build_all USE_64=1 (为64位环境/ ABI构建, 创建一个AddressSanitizer版本。)
延展命令:3 $ make build_coreconf build_dbm all BUILD_OPT=1
延展命令:4,$ make -k nss_build_all BUILD_OPT=1 (优化版本)
make nss_build_all BUILD_OPT = 1make nss_build_all NSS_ENABLE_ECC = 1make nss_build_all NS_USE_GCC = 1make nss_build_all NO_MDUPDATE = 1make nss_build_all NSS_USE_SYSTEM_SQLITE = 1make nss_build_all NSPR_INCLUDE_DIR=#{HOMEBREW_PREFIX}/include/nsprmake nss_build_all USE_64=1make build_coreconf build_dbm allmake: option requires an argument -- C Usage: make [options] [target] ... Options: -b, -m Ignored for compatibility. -B, --always-make Unconditionally make all targets. -C DIRECTORY, --directory=DIRECTORY Change to DIRECTORY before doing anything. -d Print lots of debugging information. --debug[=FLAGS] Print various types of debugging information. -e, --environment-overrides Environment variables override makefiles. -f FILE, --file=FILE, --makefile=FILE Read FILE as a makefile. -h, --help Print this message and exit. -i, --ignore-errors Ignore errors from commands. -I DIRECTORY, --include-dir=DIRECTORY Search DIRECTORY for included makefiles. -j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg. -k, --keep-going Keep going when some targets can't be made. -l [N], --load-average[=N], --max-load[=N] Don't start multiple jobs unless load is below N. -L, --check-symlink-times Use the latest mtime between symlinks and target. -n, --just-print, --dry-run, --recon Don't actually run any commands; just print them. -o FILE, --old-file=FILE, --assume-old=FILE Consider FILE to be very old and don't remake it. -p, --print-data-base Print make's internal database. -q, --question Run no commands; exit status says if up to date. -r, --no-builtin-rules Disable the built-in implicit rules. -R, --no-builtin-variables Disable the built-in variable settings. -s, --silent, --quiet Don't echo commands. -S, --no-keep-going, --stop Turns off -k. -t, --touch Touch targets instead of remaking them. -v, --version Print the version number of make and exit. -w, --print-directory Print the current directory. --no-print-directory Turn off -w, even if it was turned on implicitly. -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE Consider FILE to be infinitely new. --warn-undefined-variables Warn when an undefined variable is referenced.
安装调试过程:
cd ../coreconf ; make make[1]: Entering directory `/c/nss/security/coreconf' cd nsinstall; make export make[2]: Entering directory `/c/nss/security/coreconf/nsinstall' make[2]: Nothing to be done for `export'.
设置完所需的环境变量后,使用“cd nss / tests”并使用“./all.sh”开始测试。
测试结果:
Your HTTP Request Header GET / HTTP/1.1Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Cache-Control: max-age=0 Host: locallhost.com Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36
Administrator@SC-201801241040 /c/nss/nss/tests $ hg clone https://hg.mozilla.org/projects/nspr destination directory: nspr requesting all changes adding changesets adding manifests adding file changes added 4780 changesets with 14844 changes to 980 files (+401 heads) new changesets a4b34919bf34:d750caf6e4c6 updating to branch default 652 files updated, 0 files merged, 0 files removed, 0 files unresolved
https://bugzilla.mozilla.org/show_bug.cgi?id=525784