小编Kev*_*soL的帖子

以编程方式读取iOS中的根CA证书

以下代码读取macOS中的根证书.

我只是想知道iOS中的等效代码是什么?

https://github.com/HaxeFoundation/hxcpp/blob/7bd5ff3/src/hx/libs/ssl/SSL.cpp#L455-L491

CFMutableDictionaryRef search;
CFArrayRef result;
SecKeychainRef keychain;
SecCertificateRef item;
CFDataRef dat;
sslcert *chain = NULL;

// Load keychain
if( SecKeychainOpen("/System/Library/Keychains/SystemRootCertificates.keychain",&keychain) != errSecSuccess )
    return null();

// Search for certificates
search = CFDictionaryCreateMutable( NULL, 0, NULL, NULL );
CFDictionarySetValue( search, kSecClass, kSecClassCertificate );
CFDictionarySetValue( search, kSecMatchLimit, kSecMatchLimitAll );
CFDictionarySetValue( search, kSecReturnRef, kCFBooleanTrue );
CFDictionarySetValue( search, kSecMatchSearchList, CFArrayCreate(NULL, (const void **)&keychain, 1, NULL) );
if( SecItemCopyMatching( search, (CFTypeRef *)&result ) == errSecSuccess ){
    CFIndex n = CFArrayGetCount( result );
    for( …
Run Code Online (Sandbox Code Playgroud)

ssl ca ios root-certificate

12
推荐指数
1
解决办法
1548
查看次数

Haxe/Nodejs调试 - 源映射

如何在nodejs上启用源映射?我希望堆栈跟踪映射到.hx文件而不是生成的.js文件.

Main.hx:

package;

class Main
{
    public static function main()
        throw "test";
}
Run Code Online (Sandbox Code Playgroud)

build.hxml:

-lib hxnodejs
-cp src
-js bin/index.js
-main Main
Run Code Online (Sandbox Code Playgroud)

输出:( cd bin && node index.js)

/Users/kevin/Codes/testnodejs/bin/index.js:10
    throw new js__$Boot_HaxeError("test");
    ^
Error: test
    at Function.Main.main (/Users/kevin/Codes/testnodejs/bin/index.js:10:8)
    at console.undefined.log (/Users/kevin/Codes/testnodejs/bin/index.js:21:6)
    at Object. (/Users/kevin/Codes/testnodejs/bin/index.js:22:3)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3
Run Code Online (Sandbox Code Playgroud)

haxe node.js

1
推荐指数
1
解决办法
316
查看次数

标签 统计

ca ×1

haxe ×1

ios ×1

node.js ×1

root-certificate ×1

ssl ×1