# Fix para HTTPS en MySQL Workbench
## Problema
El módulo SSL de Python en MySQL Workbench no puede cargar `libssl.3.dylib` debido a que la aplicación usa "hardened runtime" en macOS.
Error:
```
dlopen(.../_ssl.cpython-312-darwin.so, 0x0002): Library not loaded: libssl.3.dylib
Reason: tried: 'libssl.3.dylib' (relative path not allowed in hardened program)
```
## Solución
Modificar el archivo `wb_utils_grt.py` para usar `curl` en lugar del módulo SSL de Python.
## Archivo a modificar
`/Applications/MySQLWorkbench.app/Contents/Resources/plugins/wb_utils_grt.py`
## Cambios a aplicar
### Cambio 1: Líneas ~590-600 (importación de SSL)
**ANTES:**
```python
self.is_running = True
try:
import urllib.request, urllib.error, urllib.parse
import json
import base64
import ssl
```
**DESPUÉS:**
```python
self.is_running = True
try:
import urllib.request, urllib.error, urllib.parse
import json
import base64
# Check if SSL module is available
ssl_available = False
try:
import ssl
ssl_available = True
except (ImportError, OSError):
# SSL module not available, will use curl as fallback
pass
```
### Cambio 2: Líneas ~717-760 (petición HTTPS)
**ANTES:**
```python
urllib.request.install_opener(opener)
self.json = json.load(urllib.request.urlopen("
https://workbench.mysql.com/current-release"))
```
**DESPUÉS:**
```python
urllib.request.install_opener(opener)
# Try to fetch update information
url = "
https://workbench.mysql.com/current-release"
# First, try using curl as it has its own SSL/TLS support
try:
import subprocess
result = subprocess.run(['curl', '-s', '-L', url],
capture_output=True,
text=True,
timeout=10)
if result.returncode == 0 and result.stdout:
self.json = json.loads(result.stdout)
else:
raise Exception("curl failed or returned empty response")
except Exception as curl_error:
# Fallback to urllib if curl fails
if not ssl_available:
raise Exception("HTTPS support is not available.\n\n"
"The SSL module cannot be loaded and curl is not available.\n"
"You can check for updates manually at:\n"
"
https://www.mysql.com/downloads/workbench/")
try:
context = ssl._create_unverified_context()
self.json = json.load(urllib.request.urlopen(url, context=context))
except AttributeError:
self.json = json.load(urllib.request.urlopen(url))
except urllib.error.URLError as e:
error_msg = str(e)
if 'unknown url type: https' in error_msg or 'CERTIFICATE_VERIFY_FAILED' in error_msg:
raise Exception("HTTPS support is not available.\n"
"You can check for updates manually at:\n"
"
https://www.mysql.com/downloads/workbench/")
else:
raise
```
## Cómo funciona la solución
1. **Detección de SSL**: Intenta importar el módulo `ssl` pero captura el error sin fallar
2. **Uso de curl**: Usa `curl` (que tiene su propio soporte SSL/TLS) como método principal
3. **Fallback a urllib**: Si curl falla y SSL está disponible, intenta con urllib
4. **Mensajes claros**: Proporciona mensajes de error informativos al usuario
## Ventajas
- ✅ No requiere modificar binarios del sistema
- ✅ No requiere deshabilitar SIP
- ✅ No requiere enlaces simbólicos de bibliotecas
- ✅ Usa herramientas del sistema (curl) que tienen SSL integrado
- ✅ Mantiene compatibilidad si SSL funciona en futuras versiones
## Aplicar después de actualizar
Si MySQL Workbench se actualiza y el problema persiste, simplemente vuelve a aplicar estos cambios al nuevo archivo `wb_utils_grt.py`.
---
Fecha: 28 de diciembre de 2025