Unfortunately, things are subtle and terrible (at least, compared to the abelian case). I wrote a bit about this in an unpublished article here: http://pi.math.cornell.edu/~noonan/halifax.pdf

One of the surprising, terrible features is that you can have two connections ω,η such that (1) curv ω = curv η, yet (2) ω and η are *not* gauge equivalent. Len Gross called this the "field copy problem", and it is quite weird when you sit down and think about it in terms of Yang-Mills field theory. From that perspective, you're looking at a connection whose dynamics is determined by a Lagrangian that only involves the curvature. The field copy problem shows that with nonabelian gauge groups, you can have two distinct connections that minimize the same Yang-Mills functional. In other words, observing the curvature form doesn't tell you enough to reconstruct the connection up to gauge equivalence, even in the special case of Yang-Mills connections! 

Gross analyzed the field copy problem in "A Poincaré Lemma for Connection Forms", where he found an alternative collection of observables that suffices to reconstruct the connection up to gauge equivalence. I tried to make sense of his results using 2-categories in the article I linked above. Unfortunately my research went in a different direction and I never got to follow through with this thread in the way I would have liked.