@@ -142,26 +142,22 @@ nodeOnly(() => {
142
142
const { cert } = caCertificate ;
143
143
144
144
const response = await ignoreNetworkError (
145
- fetch ( 'https://crt.sh /lintcert' , {
145
+ fetch ( 'https://pkimet.al /lintcert' , {
146
146
method : 'POST' ,
147
147
headers : { 'content-type' : 'application/x-www-form-urlencoded' } ,
148
- body : new URLSearchParams ( { 'b64cert' : cert } )
148
+ body : new URLSearchParams ( {
149
+ 'b64input' : cert ,
150
+ 'format' : 'json' ,
151
+ 'severity' : 'warning' ,
152
+ 'profile' : 'autodetect'
153
+ } )
149
154
} ) ,
150
155
{ context : this }
151
156
) ;
152
157
153
- const lintOutput = await response . text ( ) ;
154
-
155
- const lintResults = lintOutput
156
- . split ( '\n' )
157
- . map ( line => line . split ( '\t' ) . slice ( 1 ) )
158
- . filter ( line => line . length > 1 ) ;
159
-
160
- const errors = lintResults
161
- . filter ( ( [ level ] ) => level === 'ERROR' )
162
- . map ( ( [ _level , message ] ) => message ) ;
163
-
164
- expect ( errors . join ( '\n' ) ) . to . equal ( '' ) ;
158
+ expect ( response . status ) . to . equal ( 200 ) ;
159
+ const results = await response . json ( ) ;
160
+ expect ( results ) . to . deep . equal ( [ ] ) ;
165
161
} ) ;
166
162
167
163
it ( "should generate CA certs that can be used to create domain certs that pass lintcert checks" , async function ( ) {
@@ -178,34 +174,22 @@ nodeOnly(() => {
178
174
expect ( ( certData . getExtension ( 'subjectAltName' ) as any ) . altNames [ 0 ] . value ) . to . equal ( 'httptoolkit.com' ) ;
179
175
180
176
const response = await ignoreNetworkError (
181
- fetch ( 'https://crt.sh /lintcert' , {
177
+ fetch ( 'https://pkimet.al /lintcert' , {
182
178
method : 'POST' ,
183
179
headers : { 'content-type' : 'application/x-www-form-urlencoded' } ,
184
- body : new URLSearchParams ( { 'b64cert' : cert } )
180
+ body : new URLSearchParams ( {
181
+ 'b64input' : cert ,
182
+ 'format' : 'json' ,
183
+ 'severity' : 'warning' ,
184
+ 'profile' : 'autodetect'
185
+ } )
185
186
} ) ,
186
187
{ context : this }
187
188
) ;
188
189
189
190
expect ( response . status ) . to . equal ( 200 ) ;
190
- const lintOutput = await response . text ( ) ;
191
-
192
- const lintResults = lintOutput
193
- . split ( '\n' )
194
- . map ( line => line . split ( '\t' ) . slice ( 1 ) )
195
- . filter ( line => line . length > 1 ) ;
196
-
197
- const errors = lintResults
198
- . filter ( ( [ level ] ) => level === 'ERROR' || level === 'FATAL' )
199
- . map ( ( [ _level , message ] ) => message )
200
- . filter ( ( message ) =>
201
- // TODO: We don't yet support AIA due to https://github.com/digitalbazaar/forge/issues/988
202
- // This is relatively new, tricky to support (we'd need an OCSP server), and not yet required
203
- // anywhere AFAICT, so not a high priority short-term, but good to do later if possible.
204
- ! message . includes ( "OCSP" ) &&
205
- ! message . includes ( "authorityInformationAccess" )
206
- ) ;
207
-
208
- expect ( errors . join ( '\n' ) ) . to . equal ( '' ) ;
191
+ const results = await response . json ( ) ;
192
+ expect ( results ) . to . deep . equal ( [ ] ) ;
209
193
} ) ;
210
194
211
195
it ( "should generate wildcard certs that pass lintcert checks for invalid subdomain names" , async function ( ) {
@@ -267,26 +251,22 @@ nodeOnly(() => {
267
251
const { cert } = caCertificate ;
268
252
269
253
const response = await ignoreNetworkError (
270
- fetch ( 'https://crt.sh /lintcert' , {
254
+ fetch ( 'https://pkimet.al /lintcert' , {
271
255
method : 'POST' ,
272
256
headers : { 'content-type' : 'application/x-www-form-urlencoded' } ,
273
- body : new URLSearchParams ( { 'b64cert' : cert } )
257
+ body : new URLSearchParams ( {
258
+ 'b64input' : cert ,
259
+ 'format' : 'json' ,
260
+ 'severity' : 'warning' ,
261
+ 'profile' : 'autodetect'
262
+ } )
274
263
} ) ,
275
264
{ context : this }
276
265
) ;
277
266
278
- const lintOutput = await response . text ( ) ;
279
-
280
- const lintResults = lintOutput
281
- . split ( '\n' )
282
- . map ( line => line . split ( '\t' ) . slice ( 1 ) )
283
- . filter ( line => line . length > 1 ) ;
284
-
285
- const errors = lintResults
286
- . filter ( ( [ level ] ) => level === 'ERROR' )
287
- . map ( ( [ _level , message ] ) => message ) ;
288
-
289
- expect ( errors . join ( '\n' ) ) . to . equal ( '' ) ;
267
+ expect ( response . status ) . to . equal ( 200 ) ;
268
+ const results = await response . json ( ) ;
269
+ expect ( results ) . to . deep . equal ( [ ] ) ;
290
270
} ) ;
291
271
292
272
} ) ;
0 commit comments