@@ -389,7 +389,7 @@ public class SSLService : SSLServiceDelegate {
389389 // - First the CA...
390390 if let caFile = configuration. caCertificateFilePath {
391391
392- if !NSFileManager . defaultManager ( ) . fileExists ( atPath: caFile) {
392+ if !FileManager . default ( ) . fileExists ( atPath: caFile) {
393393
394394 throw SSLError . fail ( Int ( ENOENT) , " CA Certificate doesn't exist in current directory. " )
395395 }
@@ -398,7 +398,7 @@ public class SSLService : SSLServiceDelegate {
398398 if let caPath = configuration. caCertificateDirPath {
399399
400400 var isDir : ObjCBool = false
401- if !NSFileManager . defaultManager ( ) . fileExists ( atPath: caPath, isDirectory: & isDir) {
401+ if !FileManager . default ( ) . fileExists ( atPath: caPath, isDirectory: & isDir) {
402402
403403 throw SSLError . fail ( Int ( ENOENT) , " CA Certificate directory path doesn't exist. " )
404404 }
@@ -411,7 +411,7 @@ public class SSLService : SSLServiceDelegate {
411411 // - Then the certificate file...
412412 if let certFilePath = configuration. certificateFilePath {
413413
414- if !NSFileManager . defaultManager ( ) . fileExists ( atPath: certFilePath) {
414+ if !FileManager . default ( ) . fileExists ( atPath: certFilePath) {
415415
416416 throw SSLError . fail ( Int ( ENOENT) , " Certificate doesn't exist at specified path. " )
417417 }
@@ -420,7 +420,7 @@ public class SSLService : SSLServiceDelegate {
420420 // - Now the key file...
421421 if let keyFilePath = configuration. keyFilePath {
422422
423- if !NSFileManager . defaultManager ( ) . fileExists ( atPath: keyFilePath) {
423+ if !FileManager . default ( ) . fileExists ( atPath: keyFilePath) {
424424
425425 throw SSLError . fail ( Int ( ENOENT) , " Key file doesn't exist at specified path. " )
426426 }
@@ -429,7 +429,7 @@ public class SSLService : SSLServiceDelegate {
429429 // - Finally, if present, the certificate chain path...
430430 if let chainPath = configuration. certificateChainFilePath {
431431
432- if !NSFileManager . defaultManager ( ) . fileExists ( atPath: chainPath) {
432+ if !FileManager . default ( ) . fileExists ( atPath: chainPath) {
433433
434434 throw SSLError . fail ( Int ( ENOENT) , " Certificate chain doesn't exist at specified path. " )
435435 }
@@ -439,7 +439,7 @@ public class SSLService : SSLServiceDelegate {
439439 // - First the CA...
440440 if let caFile = configuration. caCertificateFilePath {
441441
442- if !FileManager. default ( ) . fileExists ( atPath: caFile) {
442+ if !FileManager. default. fileExists ( atPath: caFile) {
443443
444444 throw SSLError . fail ( Int ( ENOENT) , " CA Certificate doesn't exist in current directory. " )
445445 }
@@ -448,11 +448,11 @@ public class SSLService : SSLServiceDelegate {
448448 if let caPath = configuration. caCertificateDirPath {
449449
450450 var isDir : ObjCBool = false
451- if !FileManager. default ( ) . fileExists ( atPath: caPath, isDirectory: & isDir) {
451+ if !FileManager. default. fileExists ( atPath: caPath, isDirectory: & isDir) {
452452
453453 throw SSLError . fail ( Int ( ENOENT) , " CA Certificate directory path doesn't exist. " )
454454 }
455- if !isDir {
455+ if !isDir. boolValue {
456456
457457 throw SSLError . fail ( Int ( ENOENT) , " CA Certificate directory path doesn't specify a directory. " )
458458 }
@@ -461,7 +461,7 @@ public class SSLService : SSLServiceDelegate {
461461 // - Then the certificate file...
462462 if let certFilePath = configuration. certificateFilePath {
463463
464- if !FileManager. default ( ) . fileExists ( atPath: certFilePath) {
464+ if !FileManager. default. fileExists ( atPath: certFilePath) {
465465
466466 throw SSLError . fail ( Int ( ENOENT) , " Certificate doesn't exist at specified path. " )
467467 }
@@ -470,7 +470,7 @@ public class SSLService : SSLServiceDelegate {
470470 // - Now the key file...
471471 if let keyFilePath = configuration. keyFilePath {
472472
473- if !FileManager. default ( ) . fileExists ( atPath: keyFilePath) {
473+ if !FileManager. default. fileExists ( atPath: keyFilePath) {
474474
475475 throw SSLError . fail ( Int ( ENOENT) , " Key file doesn't exist at specified path. " )
476476 }
@@ -479,7 +479,7 @@ public class SSLService : SSLServiceDelegate {
479479 // - Finally, if present, the certificate chain path...
480480 if let chainPath = configuration. certificateChainFilePath {
481481
482- if !FileManager. default ( ) . fileExists ( atPath: chainPath) {
482+ if !FileManager. default. fileExists ( atPath: chainPath) {
483483
484484 throw SSLError . fail ( Int ( ENOENT) , " Certificate chain doesn't exist at specified path. " )
485485 }
0 commit comments