those look like crimp-on wire connectors. You'll have to cut the wires and get new ones or solder the wires together and heat shrink the connection.
I would not recommend a twist on wire nut in something that could be conceivably drenched, washed, or jostled enough that it could be knocked loose, nor would I recommend twisting them together and wrapping them with electrical tape in something that can get warm enough to possibly melt the glue.