|
@ -170,7 +170,7 @@ void SecureContext::Initialize(Handle<Object> target) { |
|
|
Handle<Value> SecureContext::New(const Arguments& args) { |
|
|
Handle<Value> SecureContext::New(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
SecureContext *p = new SecureContext(); |
|
|
SecureContext *p = new SecureContext(); |
|
|
p->Wrap(args.Holder()); |
|
|
p->Wrap(args.This()); |
|
|
return args.This(); |
|
|
return args.This(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -178,7 +178,7 @@ Handle<Value> SecureContext::New(const Arguments& args) { |
|
|
Handle<Value> SecureContext::Init(const Arguments& args) { |
|
|
Handle<Value> SecureContext::Init(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
OPENSSL_CONST SSL_METHOD *method = SSLv23_method(); |
|
|
OPENSSL_CONST SSL_METHOD *method = SSLv23_method(); |
|
|
|
|
|
|
|
@ -342,7 +342,7 @@ static X509* LoadX509 (Handle<Value> v) { |
|
|
Handle<Value> SecureContext::SetKey(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetKey(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
unsigned int len = args.Length(); |
|
|
unsigned int len = args.Length(); |
|
|
if (len != 1 && len != 2) { |
|
|
if (len != 1 && len != 2) { |
|
@ -447,7 +447,7 @@ end: |
|
|
Handle<Value> SecureContext::SetCert(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetCert(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() != 1) { |
|
|
if (args.Length() != 1) { |
|
|
return ThrowException(Exception::TypeError( |
|
|
return ThrowException(Exception::TypeError( |
|
@ -478,7 +478,7 @@ Handle<Value> SecureContext::AddCACert(const Arguments& args) { |
|
|
bool newCAStore = false; |
|
|
bool newCAStore = false; |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() != 1) { |
|
|
if (args.Length() != 1) { |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
@ -508,7 +508,7 @@ Handle<Value> SecureContext::AddCACert(const Arguments& args) { |
|
|
Handle<Value> SecureContext::AddCRL(const Arguments& args) { |
|
|
Handle<Value> SecureContext::AddCRL(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() != 1) { |
|
|
if (args.Length() != 1) { |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
@ -540,7 +540,7 @@ Handle<Value> SecureContext::AddCRL(const Arguments& args) { |
|
|
Handle<Value> SecureContext::AddRootCerts(const Arguments& args) { |
|
|
Handle<Value> SecureContext::AddRootCerts(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
assert(sc->ca_store_ == NULL); |
|
|
assert(sc->ca_store_ == NULL); |
|
|
|
|
|
|
|
@ -579,7 +579,7 @@ Handle<Value> SecureContext::AddRootCerts(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetCiphers(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetCiphers(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() != 1 || !args[0]->IsString()) { |
|
|
if (args.Length() != 1 || !args[0]->IsString()) { |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
@ -594,7 +594,7 @@ Handle<Value> SecureContext::SetCiphers(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetOptions(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetOptions(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() != 1 || !args[0]->IntegerValue()) { |
|
|
if (args.Length() != 1 || !args[0]->IntegerValue()) { |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
@ -608,7 +608,7 @@ Handle<Value> SecureContext::SetOptions(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() != 1 || !args[0]->IsString()) { |
|
|
if (args.Length() != 1 || !args[0]->IsString()) { |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
|
return ThrowException(Exception::TypeError(String::New("Bad parameter"))); |
|
@ -640,7 +640,7 @@ Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetSessionTimeout(const Arguments& args) { |
|
|
Handle<Value> SecureContext::SetSessionTimeout(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() != 1 || !args[0]->IsInt32()) { |
|
|
if (args.Length() != 1 || !args[0]->IsInt32()) { |
|
|
return ThrowTypeError("Bad parameter"); |
|
|
return ThrowTypeError("Bad parameter"); |
|
@ -654,7 +654,7 @@ Handle<Value> SecureContext::SetSessionTimeout(const Arguments& args) { |
|
|
|
|
|
|
|
|
Handle<Value> SecureContext::Close(const Arguments& args) { |
|
|
Handle<Value> SecureContext::Close(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
sc->FreeCTXMem(); |
|
|
sc->FreeCTXMem(); |
|
|
return False(node_isolate); |
|
|
return False(node_isolate); |
|
|
} |
|
|
} |
|
@ -671,7 +671,7 @@ Handle<Value> SecureContext::LoadPKCS12(const Arguments& args) { |
|
|
char* pass = NULL; |
|
|
char* pass = NULL; |
|
|
bool ret = false; |
|
|
bool ret = false; |
|
|
|
|
|
|
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); |
|
|
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() < 1) { |
|
|
if (args.Length() < 1) { |
|
|
return ThrowException(Exception::TypeError( |
|
|
return ThrowException(Exception::TypeError( |
|
@ -1213,7 +1213,7 @@ Handle<Value> Connection::New(const Arguments& args) { |
|
|
HandleScope scope(node_isolate); |
|
|
HandleScope scope(node_isolate); |
|
|
|
|
|
|
|
|
Connection *p = new Connection(); |
|
|
Connection *p = new Connection(); |
|
|
p->Wrap(args.Holder()); |
|
|
p->Wrap(args.This()); |
|
|
|
|
|
|
|
|
if (args.Length() < 1 || !args[0]->IsObject()) { |
|
|
if (args.Length() < 1 || !args[0]->IsObject()) { |
|
|
return ThrowException(Exception::Error(String::New( |
|
|
return ThrowException(Exception::Error(String::New( |
|
|