Glue connector to metal/resin case
Epoxy is not the best for smooth walled metal but excellent for FR4 which is also epoxy. The best I have found for this is high VOC Polyurethane subfloor adhesive ,now replaced with slow drying low VOC subfloor adhesive. Excellent bonding and strain relief and inexpensive XL  in tubes.