Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0b9eee5c8 |
@@ -11,6 +11,8 @@ pub enum ConnectionMode {
|
|||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct ServerConfig {
|
pub struct ServerConfig {
|
||||||
pub url: String,
|
pub url: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub allow_invalid_certs: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
|||||||
@@ -69,11 +69,28 @@ export const ServerSelection: React.FC<ServerSelectionProps> = ({ onSelect, load
|
|||||||
|
|
||||||
console.log('[ServerSelection] ✅ Connection test successful');
|
console.log('[ServerSelection] ✅ Connection test successful');
|
||||||
|
|
||||||
|
// Check if the connection requires accepting invalid certificates
|
||||||
|
const allowInvalidCerts = testResult.requiresInvalidCertAcceptance || false;
|
||||||
|
if (allowInvalidCerts) {
|
||||||
|
console.warn('[ServerSelection] ⚠️ Server uses self-signed/invalid certificate - will accept for all requests');
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch OAuth providers and check if login is enabled
|
// Fetch OAuth providers and check if login is enabled
|
||||||
const enabledProviders: SSOProviderConfig[] = [];
|
const enabledProviders: SSOProviderConfig[] = [];
|
||||||
try {
|
try {
|
||||||
console.log('[ServerSelection] Fetching login configuration...');
|
console.log('[ServerSelection] Fetching login configuration...');
|
||||||
const response = await fetch(`${url}/api/v1/proprietary/ui-data/login`);
|
|
||||||
|
// Prepare fetch options with danger mode if needed
|
||||||
|
const fetchOptions: any = {};
|
||||||
|
if (allowInvalidCerts) {
|
||||||
|
fetchOptions.danger = {
|
||||||
|
acceptInvalidCerts: true,
|
||||||
|
acceptInvalidHostnames: true,
|
||||||
|
};
|
||||||
|
console.debug('[ServerSelection] Using danger mode for login config fetch');
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(`${url}/api/v1/proprietary/ui-data/login`, fetchOptions);
|
||||||
|
|
||||||
// Check if security is disabled (status 403, 401, or 404 - endpoint doesn't exist)
|
// Check if security is disabled (status 403, 401, or 404 - endpoint doesn't exist)
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
@@ -147,11 +164,12 @@ export const ServerSelection: React.FC<ServerSelectionProps> = ({ onSelect, load
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connection successful - pass URL and OAuth providers
|
// Connection successful - pass URL, OAuth providers, and cert settings
|
||||||
console.log('[ServerSelection] ✅ Server selection complete, proceeding to login');
|
console.log('[ServerSelection] ✅ Server selection complete, proceeding to login');
|
||||||
onSelect({
|
onSelect({
|
||||||
url,
|
url,
|
||||||
enabledOAuthProviders: enabledProviders.length > 0 ? enabledProviders : undefined,
|
enabledOAuthProviders: enabledProviders.length > 0 ? enabledProviders : undefined,
|
||||||
|
allow_invalid_certs: allowInvalidCerts,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[ServerSelection] ❌ Unexpected error during connection test:', error);
|
console.error('[ServerSelection] ❌ Unexpected error during connection test:', error);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export interface SSOProviderConfig {
|
|||||||
export interface ServerConfig {
|
export interface ServerConfig {
|
||||||
url: string;
|
url: string;
|
||||||
enabledOAuthProviders?: SSOProviderConfig[];
|
enabledOAuthProviders?: SSOProviderConfig[];
|
||||||
|
allow_invalid_certs?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ConnectionConfig {
|
export interface ConnectionConfig {
|
||||||
@@ -31,6 +32,7 @@ export interface ConnectionTestResult {
|
|||||||
error?: string;
|
error?: string;
|
||||||
errorCode?: string;
|
errorCode?: string;
|
||||||
diagnostics?: DiagnosticResult[];
|
diagnostics?: DiagnosticResult[];
|
||||||
|
requiresInvalidCertAcceptance?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ConnectionModeService {
|
export class ConnectionModeService {
|
||||||
@@ -256,10 +258,11 @@ export class ConnectionModeService {
|
|||||||
console.log(`[ConnectionModeService] ✅ CONNECTION SUCCESSFUL (with certificate bypass)`);
|
console.log(`[ConnectionModeService] ✅ CONNECTION SUCCESSFUL (with certificate bypass)`);
|
||||||
console.log(`[ConnectionModeService] Protocol: HTTPS with certificate validation disabled`);
|
console.log(`[ConnectionModeService] Protocol: HTTPS with certificate validation disabled`);
|
||||||
console.log(`[ConnectionModeService] Duration: ${stage2Result.duration}ms`);
|
console.log(`[ConnectionModeService] Duration: ${stage2Result.duration}ms`);
|
||||||
console.log(`[ConnectionModeService] Note: Server has missing intermediate certificate or invalid cert`);
|
console.log(`[ConnectionModeService] Note: Server has self-signed or invalid certificate - allowing connection`);
|
||||||
console.log(`[ConnectionModeService] ==================== DIAGNOSTIC SESSION END ====================`);
|
console.log(`[ConnectionModeService] ==================== DIAGNOSTIC SESSION END ====================`);
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
requiresInvalidCertAcceptance: true,
|
||||||
diagnostics,
|
diagnostics,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user