summary refs log tree commit diff stats
path: root/lib/impure/ssl.nim
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2015-09-04 23:03:56 +0200
committerAdam Strzelecki <ono@java.pl>2015-09-04 23:03:56 +0200
commit43bddf62dd982e64cd7350eabbbc5d04c5adab21 (patch)
tree30d912ddcdf47201ea5b650d8a0064949fc0472e /lib/impure/ssl.nim
parentd68181246571de5799059cf6402f1c578cd9421c (diff)
downloadNim-43bddf62dd982e64cd7350eabbbc5d04c5adab21.tar.gz
lib: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
Diffstat (limited to 'lib/impure/ssl.nim')
-rw-r--r--lib/impure/ssl.nim26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/impure/ssl.nim b/lib/impure/ssl.nim
index 079a2c3a2..721e5ce51 100644
--- a/lib/impure/ssl.nim
+++ b/lib/impure/ssl.nim
@@ -7,7 +7,7 @@
 #    distribution, for details about the copyright.
 #
 
-## This module provides an easy to use sockets-style 
+## This module provides an easy to use sockets-style
 ## nim interface to the OpenSSL library.
 
 {.deprecated.}
@@ -20,37 +20,37 @@ type
     bio: BIO
 {.deprecated: [TSecureSocket: SecureSocket].}
 
-proc connect*(sock: var SecureSocket, address: string, 
+proc connect*(sock: var SecureSocket, address: string,
     port: int): int =
   ## Connects to the specified `address` on the specified `port`.
   ## Returns the result of the certificate validation.
   SslLoadErrorStrings()
   ERR_load_BIO_strings()
-  
+
   if SSL_library_init() != 1:
     raiseOSError(osLastError())
-  
+
   var ctx = SSL_CTX_new(SSLv23_client_method())
   if ctx == nil:
     ERR_print_errors_fp(stderr)
     raiseOSError(osLastError())
-    
-  #if SSL_CTX_load_verify_locations(ctx, 
+
+  #if SSL_CTX_load_verify_locations(ctx,
   #   "/tmp/openssl-0.9.8e/certs/vsign1.pem", NIL) == 0:
   #  echo("Failed load verify locations")
   #  ERR_print_errors_fp(stderr)
-  
+
   sock.bio = BIO_new_ssl_connect(ctx)
   if BIO_get_ssl(sock.bio, addr(sock.ssl)) == 0:
     raiseOSError(osLastError())
 
   if BIO_set_conn_hostname(sock.bio, address & ":" & $port) != 1:
     raiseOSError(osLastError())
-  
+
   if BIO_do_connect(sock.bio) <= 0:
     ERR_print_errors_fp(stderr)
     raiseOSError(osLastError())
-  
+
   result = SSL_get_verify_result(sock.ssl)
 
 proc recvLine*(sock: SecureSocket, line: var TaintedString): bool =
@@ -86,12 +86,12 @@ proc close*(sock: SecureSocket) =
 when not defined(testing) and isMainModule:
   var s: SecureSocket
   echo connect(s, "smtp.gmail.com", 465)
-  
+
   #var buffer: array[0..255, char]
   #echo BIO_read(bio, buffer, buffer.len)
   var buffer: string = ""
-  
+
   echo s.recvLine(buffer)
-  echo buffer 
+  echo buffer
   echo buffer.len
-  
+