That silicon rubber looking stuff is called conformal coating and that is precisely what it is used for. I used to work for a company that built the electronics for VitaSpa hot tubs. We had to cover all of the boards with that messy stuff, so they would survive all of the chlorine/bromine vapors involved with the tubs.