mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-30 19:20:40 -04:00 
			
		
		
		
	Fix ssl_set_hostname usage (duplication, ifdef)
This commit is contained in:
		
							parent
							
								
									55fab2de5d
								
							
						
					
					
						commit
						159c82ecc6
					
				| @ -1149,11 +1149,6 @@ int main( int argc, char *argv[] ) | ||||
|             goto exit; | ||||
|         } | ||||
|     } | ||||
|     if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 ) | ||||
|     { | ||||
|         mbedtls_printf( " failed\n  ! mbedtls_ssl_set_hostname returned %d\n\n", ret ); | ||||
|         goto exit; | ||||
|     } | ||||
| #endif | ||||
| 
 | ||||
| #if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) | ||||
|  | ||||
| @ -603,11 +603,6 @@ int main( int argc, char *argv[] ) | ||||
|         mbedtls_ssl_conf_ciphersuites( &conf, opt.force_ciphersuite ); | ||||
| 
 | ||||
|     mbedtls_ssl_conf_ca_chain( &conf, &cacert, NULL ); | ||||
|     if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 ) | ||||
|     { | ||||
|         mbedtls_printf( " failed\n  ! mbedtls_ssl_set_hostname returned %d\n\n", ret ); | ||||
|         goto exit; | ||||
|     } | ||||
|     if( ( ret = mbedtls_ssl_conf_own_cert( &conf, &clicert, &pkey ) ) != 0 ) | ||||
|     { | ||||
|         mbedtls_printf( " failed\n  ! mbedtls_ssl_conf_own_cert returned %d\n\n", ret ); | ||||
| @ -620,13 +615,11 @@ int main( int argc, char *argv[] ) | ||||
|         goto exit; | ||||
|     } | ||||
| 
 | ||||
| #if defined(MBEDTLS_x509_CRT_PARSE_C) | ||||
|     if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 ) | ||||
|     { | ||||
|         mbedtls_printf( " failed\n  ! mbedtls_ssl_set_hostname returned %d\n\n", ret ); | ||||
|         goto exit; | ||||
|     } | ||||
| #endif | ||||
| 
 | ||||
|     mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Manuel Pégourié-Gonnard
						Manuel Pégourié-Gonnard