mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-10-30 21:35:26 +01:00 
			
		
		
		
	Added --openssl-timeout parameter
In some cases OpenSSL processes hanged indefinitely while scans. This new parameter allows to wrap the "timeout" tool around the openssl invocation.
This commit is contained in:
		
							
								
								
									
										10
									
								
								testssl.sh
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								testssl.sh
									
									
									
									
									
								
							| @@ -134,7 +134,7 @@ TERM_CURRPOS=0                                         # custom line wrapping ne | ||||
| # following variables make use of $ENV, e.g. OPENSSL=<myprivate_path_to_openssl> ./testssl.sh <host> | ||||
| # 0 means (normally) true here. Some of the variables are also accessible with a command line switch, see --help | ||||
|  | ||||
| declare -x OPENSSL | ||||
| declare -x OPENSSL OPENSSL_TIMEOUT | ||||
| COLOR=${COLOR:-2}                       # 2: Full color, 1: b/w+positioning, 0: no ESC at all | ||||
| COLORBLIND=${COLORBLIND:-false}         # if true, swap blue and green in the output | ||||
| SHOW_EACH_C=${SHOW_EACH_C:-false}       # where individual ciphers are tested show just the positively ones tested | ||||
| @@ -6734,6 +6734,10 @@ find_openssl_binary() { | ||||
|      $OPENSSL s_client -help 2>&1 | grep -qw '\-nextprotoneg' && \ | ||||
|           HAS_SPDY=true | ||||
|  | ||||
|      if [[ "$OPENSSL_TIMEOUT" != "" ]]; then | ||||
|           OPENSSL="timeout --preserve-status $OPENSSL_TIMEOUT $OPENSSL" | ||||
|      fi | ||||
|  | ||||
|      return 0 | ||||
| } | ||||
|  | ||||
| @@ -8076,6 +8080,10 @@ parse_cmd_line() { | ||||
|                     OPENSSL=$(parse_opt_equal_sign "$1" "$2") | ||||
|                     [[ $? -eq 0 ]] && shift | ||||
|                     ;; | ||||
|                --openssl-timeout|--openssl-timeout=*) | ||||
|                     OPENSSL_TIMEOUT=$(parse_opt_equal_sign "$1" "$2") | ||||
|                     [[ $? -eq 0 ]] && shift | ||||
|                     ;; | ||||
|                --mapping|--mapping=*) | ||||
|                     local cipher_mapping | ||||
|                     cipher_mapping=$(parse_opt_equal_sign "$1" "$2") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Thomas Patzke
					Thomas Patzke