What’s causing this man’s rash?

Hint: It is associated with diabetes mellitus or thyroid disease
Source: NEJM

A 64-year-old man presents with a two-year history of this asymptomatic skin condition, which was symmetrically distributed over his trunk, arms and legs.

Laboratory tests demonstrated a raised fasting blood glucose level. 

What is the most likely diagnosis?