This paper studies duality and optimality conditions in general convex stochastic optimization problems introduced by Rockafellar and Wets in \cite{rw76}. We derive an explicit dual problem in terms of two dual variables, one of which is the shadow price of information while the other one gives the marginal cost of a perturbation much like in classical Lagrangian duality. Existence of primal solutions and the absence of duality gap are obtained without compactness or boundedness assumptions. In the context of financial mathematics, the relaxed assumptions are satisfied under the well-known no-arbitrage condition and the reasonable asymptotic elasticity condition of the utility function. We extend classical portfolio optimization duality theory to problems of optimal semi-static hedging. Besides financial mathematics, we obtain several new frameworks in stochastic programming and stochastic optimal control.