@apiverve/tlscheck 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/index.js +90 -0
- package/package.json +32 -0
- package/tmp/build.dat +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 APIVerve, and Evlar LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
TLS Checker API
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
TLS Check is an API that inspects the TLS/SSL configuration of a server identified by its IP address. It reports supported protocols, cipher suites, and potential vulnerabilities.
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
This is a Javascript Wrapper for the [TLS Checker API](https://apiverve.com/marketplace/api/tlscheck)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
npm install @apiverve/tlscheck --save
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
Before using the tlscheck API client, you have to setup your account and obtain your API Key.
|
|
22
|
+
You can get it by signing up at [https://apiverve.com](https://apiverve.com)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
The TLS Checker API documentation is found here: [https://docs.apiverve.com/api/tlscheck](https://docs.apiverve.com/api/tlscheck).
|
|
29
|
+
You can find parameters, example responses, and status codes documented here.
|
|
30
|
+
|
|
31
|
+
### Setup
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
var tlscheckAPI = require('@apiverve/tlscheck');
|
|
35
|
+
var api = new tlscheckAPI({
|
|
36
|
+
api_key: [YOUR_API_KEY],
|
|
37
|
+
secure: true //(Optional, defaults to true)
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Perform Request
|
|
45
|
+
Using the API client, you can perform requests to the API.
|
|
46
|
+
|
|
47
|
+
###### Define Query
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
var query = {
|
|
51
|
+
domain: "amazon.com",
|
|
52
|
+
port: 443
|
|
53
|
+
};
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
###### Simple Request (using Callback)
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
api.execute(query, function (error, data) {
|
|
60
|
+
if (error) {
|
|
61
|
+
return console.error(error);
|
|
62
|
+
} else {
|
|
63
|
+
console.log(data);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
###### Example Response
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
{
|
|
72
|
+
"status": "ok",
|
|
73
|
+
"error": null,
|
|
74
|
+
"data": {
|
|
75
|
+
"domain": "amazon.com",
|
|
76
|
+
"tlsVersions": {
|
|
77
|
+
"TLSv1": false,
|
|
78
|
+
"TLSv1.1": false,
|
|
79
|
+
"TLSv1.2": true,
|
|
80
|
+
"TLSv1.3": true
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"code": 200
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Customer Support
|
|
90
|
+
|
|
91
|
+
Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact).
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Updates
|
|
96
|
+
Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Legal
|
|
101
|
+
|
|
102
|
+
All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
Licensed under the The MIT License (MIT)
|
|
108
|
+
|
|
109
|
+
Copyright (©) 2025 APIVerve, and EvlarSoft LLC
|
|
110
|
+
|
|
111
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
112
|
+
|
|
113
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
114
|
+
|
|
115
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/index.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
|
|
3
|
+
class tlscheckWrapper {
|
|
4
|
+
|
|
5
|
+
constructor(options) {
|
|
6
|
+
if (!options || typeof options !== 'object') {
|
|
7
|
+
throw new Error('Options object must be provided.');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { api_key, secure = true } = options;
|
|
11
|
+
|
|
12
|
+
if (!api_key || typeof api_key !== 'string') {
|
|
13
|
+
throw new Error('API key must be provided as a non-empty string.');
|
|
14
|
+
}
|
|
15
|
+
if (typeof secure !== 'boolean') {
|
|
16
|
+
throw new Error('Secure parameter must be a boolean value.');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
this.APIKey = api_key;
|
|
20
|
+
this.IsSecure = secure;
|
|
21
|
+
|
|
22
|
+
// secure is deprecated, all requests must be made over HTTPS
|
|
23
|
+
this.baseURL = 'https://api.apiverve.com/v1/tlscheck';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async execute(query, callback) {
|
|
27
|
+
if(arguments.length > 1) {
|
|
28
|
+
if (!query || typeof query !== 'object') {
|
|
29
|
+
throw new Error('Query parameters must be provided as an object.');
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
callback = query;
|
|
33
|
+
query = {};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var requiredParams = ["domain"];
|
|
37
|
+
if (requiredParams.length > 0) {
|
|
38
|
+
for (var i = 0; i < requiredParams.length; i++) {
|
|
39
|
+
if (!query[requiredParams[i]]) {
|
|
40
|
+
throw new Error(`Required parameter [${requiredParams[i]}] is missing.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const method = 'GET';
|
|
46
|
+
const url = method === 'POST' ? this.baseURL : this.constructURL(query);
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const response = await axios({
|
|
50
|
+
method,
|
|
51
|
+
url,
|
|
52
|
+
headers: {
|
|
53
|
+
'Content-Type': 'application/json',
|
|
54
|
+
'x-api-key': this.APIKey,
|
|
55
|
+
'auth-mode': 'npm-package'
|
|
56
|
+
},
|
|
57
|
+
data: method === 'POST' ? query : undefined
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const data = response.data;
|
|
61
|
+
callback(null, data);
|
|
62
|
+
return data;
|
|
63
|
+
} catch (error) {
|
|
64
|
+
if (error.response.data) {
|
|
65
|
+
callback(error.response.data, null);
|
|
66
|
+
throw error.response.data;
|
|
67
|
+
} else {
|
|
68
|
+
callback(error, null);
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
constructURL(query) {
|
|
75
|
+
let url = this.baseURL;
|
|
76
|
+
|
|
77
|
+
if(query && typeof query === 'object')
|
|
78
|
+
{
|
|
79
|
+
if (Object.keys(query).length > 0) {
|
|
80
|
+
const queryString = Object.keys(query)
|
|
81
|
+
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(query[key])}`)
|
|
82
|
+
.join('&');
|
|
83
|
+
url += `?${queryString}`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return url;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
module.exports = tlscheckWrapper;
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@apiverve/tlscheck",
|
|
3
|
+
"version": "1.1.9",
|
|
4
|
+
"description": "TLS Check is an API that inspects the TLS/SSL configuration of a server identified by its IP address. It reports supported protocols, cipher suites, and potential vulnerabilities.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "mocha"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/apiverve/tlscheck-API.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"tls check","ssl check","tls configuration","ssl scan","https"
|
|
15
|
+
],
|
|
16
|
+
"author": "APIVerve <hello@apiverve.com> (http://apiverve.com/)",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/apiverve/tlscheck-API/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://apiverve.com/marketplace/api/tlscheck?utm_source=npm",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"mocha": "^11.0.1",
|
|
24
|
+
"chai": "^5.1.2",
|
|
25
|
+
"dotenv": "^16.4.7"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"node-fetch": "^3.3.2",
|
|
29
|
+
"promise": "^8.3.0",
|
|
30
|
+
"axios": "1.8.4"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/tmp/build.dat
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#
|