2 is more close to the meaning of "王八", which is associated with the "turtle". The association started in the ancient brothel, in which the prostitute was carried on the back of a servant from one location to another to serve the customers who were buying sex. The bended/bowed body of the servant looked somewhat similar to the shape of a turtle, therefore, was given the name - "turtle slave (龟奴)".
Years later, when getting aged up, due to difficulty in finding a normal person for marriage, many old prostitutes became the wife of the servant (龟奴). When falling into difficult times, many would resort back to the old, familiar business - prostitution. But instead of working in brothels, now the sex selling was conducted from home, often with the full knowledge and nodding of the husband. By means of insult, people gave the husband the name "王八", for his knowledge and acceptance of his wife's sex deals, and sometimes referred to a husband, who disliked, but was too afraid to interfere/stop the wife's prostitution business. Later, the name extended to cover a man, whose wife has extramarital affairs with or without his knowledge.