- Added support for self-signed TLS certificates in the ApiService, allowing configuration based on server settings. - Introduced a toggle in the ServerConnectionPage to enable or disable trusting self-signed certificates. - Updated localization files to include new strings for self-signed certificate settings in multiple languages. - Enhanced the OptimizedStorageService to manage trusted servers based on user preferences for self-signed certificates. - Improved error handling and logging throughout the affected services to ensure clarity and maintainability.
24 lines
675 B
Dart
24 lines
675 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'server_config.freezed.dart';
|
|
part 'server_config.g.dart';
|
|
|
|
@freezed
|
|
sealed class ServerConfig with _$ServerConfig {
|
|
const factory ServerConfig({
|
|
required String id,
|
|
required String name,
|
|
required String url,
|
|
String? apiKey,
|
|
@Default({}) Map<String, String> customHeaders,
|
|
DateTime? lastConnected,
|
|
@Default(false) bool isActive,
|
|
|
|
/// Whether to trust self-signed TLS certificates for this server.
|
|
@Default(false) bool allowSelfSignedCertificates,
|
|
}) = _ServerConfig;
|
|
|
|
factory ServerConfig.fromJson(Map<String, dynamic> json) =>
|
|
_$ServerConfigFromJson(json);
|
|
}
|