Ceiling fan/light in bathroom shortcuts when humid
You could apply liquid electrical tape around the connector to reduce the moisture getting to the electrical connections.
For a better seal, remove the connector and wire it using heat shrink butt connectors, or use regular butt connectors with heat shrink tubing and a water proof sealant like liquid electrical tape.  This will reduce the ability for moisture to get into the connector.  Though I understand this might be more difficult to do with some light/fan combos.